Browse Source

修改收料单接口

koul 3 years ago
parent
commit
205c5085f2

+ 1 - 1
src/main/java/com/uas/eis/service/Impl/ERPServiceImpl.java

@@ -74,7 +74,7 @@ public class ERPServiceImpl implements ERPService {
             Map<Object, Object> store = BaseUtil.parseFormStoreToMap(data);
             VerifyApply verifyApply = baseDao.getJdbcTemplate().queryForObject("select va_id,va_mescode,va_code,to_char(va_date,'yyyy-MM-dd HH24:mi:ss') va_date,va_vendcode,va_vendname,va_currency,va_rate,va_paymentscode,va_payments,va_transport,va_sendcode,va_emcode,va_emname,va_departmentcode,va_department,va_recorder,case when nvl(va_cop,' ')=' ' then 'BYT' else va_cop end va_cop,va_remark,va_ancode,va_factory,0 version,va_type,va_pucode,case when nvl(va_pucode,' ')=' ' then 0 else (select pu_id from purchase where pu_code=va_pucode) end pu_id,va_status,1 posted,to_char(va_auditdate,'yyyy-MM-dd HH24:mi:ss') va_auditdate,va_auditman,va_custcode,va_custname from VerifyApply where va_id=?",
                     new BeanPropertyRowMapper<VerifyApply>(VerifyApply.class), store.get("va_id"));
-            SqlRowList rs = baseDao.queryForRowSet("select case when va_custcode='柏英特' or nvl(va_custcode,' ')=' ' then 'BYT' else nvl(cu_mescode,cu_code) end cu_code,cu_name from verifyapply left join customer on va_custcode=cu_code where va_id="+store.get("va_id"));
+            SqlRowList rs = baseDao.queryForRowSet("select case when va_custcode='AR214' or nvl(va_custcode,' ')=' ' then 'BYT' else nvl(cu_mescode,cu_code) end cu_code,cu_name from verifyapply left join customer on va_custcode=cu_code where va_id="+store.get("va_id"));
             if (rs.next()){
                 verifyApply.setVa_custcode(rs.getString("cu_code"));
                 //verifyApply.setVa_custname(rs.getString("cu_name"));

+ 3 - 4
src/main/java/com/uas/eis/service/Impl/MESServiceImpl.java

@@ -45,18 +45,17 @@ public class MESServiceImpl implements MESService {
         if ("".equals(mesCode)){
             return ApiResponse.failRsp("10011",request.getHeader("RequestId"),"MES编号不能为空!");
         }
-        VerifyApply verifyApply = baseDao.getJdbcTemplate().queryForObject("select va_id,va_mescode,va_code,to_char(va_date,'yyyy-MM-dd HH24:mi:ss') va_date,va_vendcode,va_vendname,va_currency,va_rate,va_paymentscode,va_payments,va_transport,va_sendcode,va_emcode,va_emname,va_departmentcode,va_department,va_recorder,nvl(va_cop,'BYT') va_cop,va_remark,va_ancode,va_factory,0 version,va_type,va_pucode,case when nvl(va_pucode,' ')=' ' then 0 else (select pu_id from purchase where pu_code=va_pucode) end pu_id,va_status,1 posted,to_char(va_auditdate,'yyyy-MM-dd HH24:mi:ss') va_auditdate,va_auditman,va_custcode,va_custname from VerifyApply where va_statuscode='AUDITED' and va_mescode=?",
+        VerifyApply verifyApply = baseDao.getJdbcTemplate().queryForObject("select va_id,va_mescode,va_code,to_char(va_date,'yyyy-MM-dd HH24:mi:ss') va_date,va_vendcode,va_vendname,va_currency,va_rate,va_paymentscode,va_payments,va_transport,va_sendcode,va_emcode,va_emname,va_departmentcode,va_department,va_recorder,case when nvl(va_cop,' ')=' ' then 'BYT' else va_cop end va_cop,va_remark,va_ancode,va_factory,0 version,va_type,va_pucode,case when nvl(va_pucode,' ')=' ' then 0 else (select pu_id from purchase where pu_code=va_pucode) end pu_id,va_status,1 posted,to_char(va_auditdate,'yyyy-MM-dd HH24:mi:ss') va_auditdate,va_auditman,va_custcode,va_custname from VerifyApply where va_statuscode='AUDITED' and va_mescode=?",
                 new BeanPropertyRowMapper<VerifyApply>(VerifyApply.class), mesCode);
 
         if (verifyApply==null) {
             return ApiResponse.failRsp("10012",request.getHeader("RequestId"),"单据未审核或不存在,请确认!");
         }
-        SqlRowList rs = baseDao.queryForRowSet("select case when va_custcode='柏英特' or nvl(va_custcode,' ')=' ' then 'BYT' else nvl(cu_mescode,cu_code) end cu_code,cu_name from verifyapply left join customer on va_custcode=cu_code where va_statuscode='AUDITED' and va_mescode='"+mesCode+"'");
+        SqlRowList rs = baseDao.queryForRowSet("select case when va_custcode='AR214' or nvl(va_custcode,' ')=' ' then 'BYT' else nvl(cu_mescode,cu_code) end cu_code,cu_name from verifyapply left join customer on va_custcode=cu_code where va_statuscode='AUDITED' and va_mescode='"+mesCode+"'");
         if (rs.next()){
             verifyApply.setVa_custcode(rs.getString("cu_code"));
-            //verifyApply.setVa_custname(rs.getString("cu_name"));
         }
-        List<VerifyApplyDetail> verifyApplyDetails = baseDao.query("select vad_code,vad_prodcode,pr_detail,pr_spec,pr_unit,va_recorder,va_date,pr_kh_user,cu_name,sum(nvl(vad_qty,0)) vad_qty,vad_salecode from (select vad_code,vad_prodcode,pr_detail,pr_spec,pr_unit,vad_qty,va_recorder,to_char(va_date,'yyyy-MM-dd HH24:mi:ss') va_date,case when pr_kh_user='柏英特' or nvl(pr_kh_user,' ')=' ' then 'BYT' else nvl(cu_mescode,cu_code) end pr_kh_user,cu_name,vad_salecode from verifyapplydetail left join VerifyApply on va_id=vad_vaid left join product on vad_prodcode=pr_code left join customer on cu_shortname=pr_kh_user where vad_vaid="+verifyApply.getVa_id()+") group by vad_code,vad_prodcode,pr_detail,pr_spec,pr_unit,va_recorder,va_date,pr_kh_user,cu_name,vad_salecode", VerifyApplyDetail.class);
+        List<VerifyApplyDetail> verifyApplyDetails = baseDao.query("select vad_code,vad_prodcode,pr_detail,replace(PR_SPEC,'''','''''') pr_spec,pr_unit,va_recorder,va_date,pr_kh_user,cu_name,sum(nvl(vad_qty,0)) vad_qty,vad_salecode from ( select vad_code,vad_prodcode,pr_detail,pr_spec,pr_unit,vad_qty,va_recorder,to_char(va_date,'yyyy-MM-dd HH24:mi:ss') va_date,case when pr_kh_user='柏英特' or nvl(pr_kh_user,' ')=' ' then 'BYT' else nvl(cu_mescode,cu_code) end pr_kh_user,cu_name,vad_salecode from verifyapplydetail left join VerifyApply on va_id=vad_vaid left join product on vad_prodcode=pr_code left join customer on cu_shortname=pr_kh_user where nvl(vad_qty,0)>0 and vad_vaid="+verifyApply.getVa_id()+") group by vad_code,vad_prodcode,pr_detail,pr_spec,pr_unit,va_recorder,va_date,pr_kh_user,cu_name,vad_salecode", VerifyApplyDetail.class);
         verifyApply.setDetail(verifyApplyDetails);
         String s = JSON.toJSONString(verifyApply, SerializerFeature.WriteMapNullValue);
         return ApiResponse.successRsp("0","获取成功!",request.getHeader("RequestId"),s);