|
|
@@ -73,7 +73,7 @@ public class ERPServiceImpl implements ERPService {
|
|
|
public ApiResult<String> syncUpdateReceiveByErp(String data) {
|
|
|
try {
|
|
|
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=?",
|
|
|
+ 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,'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_id=?",
|
|
|
new BeanPropertyRowMapper<VerifyApply>(VerifyApply.class), 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()){
|
|
|
@@ -150,13 +150,15 @@ public class ERPServiceImpl implements ERPService {
|
|
|
String mesUser = tokenConfig.get("mesUser");
|
|
|
String mesPwd = MD5Util.encodeByMD5(tokenConfig.get("mesPwd"));
|
|
|
int flag = Integer.parseInt(StringUtil.nvl(store.get("flag"), "-1"));
|
|
|
- List<ProdInOutMakeGiveDetail> prodInOutMakeGiveDetails = baseDao.query("select '"+mesUser+"' mesUser,'"+mesPwd+"' mesPwd," +
|
|
|
- "pi_inoutno,pd_ordercode,mm_id,pd_prodcode,pd_outqty," +
|
|
|
- "case when pr_kh_user='柏英特' or nvl(pr_kh_user,' ')=' ' then 'BYT' else nvl(cu_mescode,cu_code) end pi_cop," +
|
|
|
- "cu_name,pi_recordman,to_char(pi_recorddate,'yyyy-MM-dd HH24:mi:ss') pi_recorddate,pi_updateman," +
|
|
|
+ ProdInOutMakeGive prodInOutMakeGive = baseDao.getJdbcTemplate().queryForObject("select '"+mesUser+"' mesUser,'"+mesPwd+"' mesPwd,(select wm_concat(distinct pd_ordercode) from prodiodetail where pd_piid=pi_id) maCodes,pi_inoutno from prodinout where pi_id=?",
|
|
|
+ new BeanPropertyRowMapper<ProdInOutMakeGive>(ProdInOutMakeGive.class), store.get("pi_id"));
|
|
|
+
|
|
|
+ List<ProdInOutMakeGiveDetail> prodInOutMakeGiveDetails = baseDao.query("select pd_ordercode,mm_id,pd_prodcode,pd_outqty," +
|
|
|
+ "'BYT' pi_cop,pi_recordman,to_char(pi_recorddate,'yyyy-MM-dd HH24:mi:ss') pi_recorddate,pi_updateman," +
|
|
|
"case when pi_updatedate is not null then to_char(pi_updatedate,'yyyy-MM-dd HH24:mi:ss') else null end pi_updatedate,"+flag+" flag " +
|
|
|
"from prodiodetail left join prodinout on pd_piid=pi_id left join product on pd_prodcode=pr_code left join customer on cu_shortname=pr_kh_user left join MakeMaterial on pd_ordercode=mm_code and pd_orderdetno=mm_detno where nvl(pd_outqty,0)>nvl((select sum(ba_remain) from batch where nvl(ba_macode,' ')=pd_ordercode and pd_prodcode=ba_prodcode and ba_whcode in (select wh_code from Warehouse where wh_statuscode='AUDITED' and wh_description like '%线边仓%') and nvl(ba_remain,0)>0),0) and pi_id=" + store.get("pi_id"), ProdInOutMakeGiveDetail.class);
|
|
|
- return syncMES(JSON.toJSONString(prodInOutMakeGiveDetails, SerializerFeature.WriteMapNullValue).replace("null","\"\""),tokenConfig.get("syncProdInOutMakeGive"));
|
|
|
+ prodInOutMakeGive.setDetail(prodInOutMakeGiveDetails);
|
|
|
+ return syncMES(JSON.toJSONString(prodInOutMakeGive, SerializerFeature.WriteMapNullValue).replace("null","\"\""),tokenConfig.get("syncProdInOutMakeGive"));
|
|
|
}catch (Exception e){
|
|
|
logger.error("同步补料单异常信息:"+e.getMessage());
|
|
|
e.printStackTrace();
|