|
|
@@ -472,8 +472,53 @@ public class ERPServiceImpl implements ERPService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> createPACKINGASN(String id) {
|
|
|
- return null;
|
|
|
+ public Map<String, Object> createPackingASN(String id) {
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
+ UUID uuid = UUID.randomUUID();
|
|
|
+ ASNBoxMain asnBoxMain = new ASNBoxMain();
|
|
|
+ asnBoxMain.setSYSTEMID("SRM");
|
|
|
+ asnBoxMain.setGUID(uuid.toString().replaceAll("-", "").toUpperCase());
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select * from asnBoxXM where asnb_id=" + id);
|
|
|
+ // 获取当前日期
|
|
|
+ Date currentDate = new Date();
|
|
|
+ // 创建SimpleDateFormat对象,指定格式
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
+ SimpleDateFormat hhmmss = new SimpleDateFormat("yyyyMMddHHMMSS");
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ if (rs.next()){
|
|
|
+ String asn_code = rs.getGeneralString("asn_code");
|
|
|
+ asnBoxMain.setMIASN_NUM(rs.getGeneralString("miasn_num"));
|
|
|
+ asnBoxMain.setDELIVERY_NOTICE(rs.getGeneralString("delivery_notice"));
|
|
|
+ asnBoxMain.setSUPPLIER_CODE(rs.getGeneralString("supplier_code"));
|
|
|
+ asnBoxMain.setSUPPLIER_NAME(rs.getGeneralString("supplier_name"));
|
|
|
+ asnBoxMain.setOPERATE_TIME(rs.getGeneralString("operate_time"));
|
|
|
+ List<ASNBoxItem> IT_ASN_PACK = new ArrayList<>();
|
|
|
+ SqlRowList rs_asnbDetail = baseDao.queryForRowSet("select * from asnboxDetailXM where asnbd_asnbid=" + id);
|
|
|
+ if (rs_asnbDetail.next()){
|
|
|
+ ASNBoxItem asnBoxItem = new ASNBoxItem();
|
|
|
+ asnBoxItem.setBOX_SEQ(rs_asnbDetail.getGeneralString("box_seq"));
|
|
|
+ asnBoxItem.setBOX_NUM(rs_asnbDetail.getGeneralString("box_num"));
|
|
|
+ asnBoxItem.setCARTON_ID(rs_asnbDetail.getGeneralString("carton_id"));
|
|
|
+ asnBoxItem.setMATERIAL_NUM(rs_asnbDetail.getGeneralString("material_num"));
|
|
|
+ asnBoxItem.setSUPP_MAT_NUM(rs_asnbDetail.getGeneralString("supp_mat_num"));
|
|
|
+ asnBoxItem.setSHIP_QTY(rs_asnbDetail.getGeneralString("ship_qty"));
|
|
|
+ asnBoxItem.setMODELNUMBER(rs_asnbDetail.getGeneralString("modelnumber"));
|
|
|
+ asnBoxItem.setBRAND(rs_asnbDetail.getGeneralString("brand"));
|
|
|
+ asnBoxItem.setCOUNTRY_ORIGIN(rs_asnbDetail.getGeneralString("country_origin"));
|
|
|
+ asnBoxItem.setNETWEI_PERPC(rs_asnbDetail.getGeneralString("netwei_perpc"));
|
|
|
+ asnBoxItem.setDATE_CODE(rs_asnbDetail.getGeneralString("date_code"));
|
|
|
+ asnBoxItem.setPRODUCTION_LOT(rs_asnbDetail.getGeneralString("production_lot"));
|
|
|
+ IT_ASN_PACK.add(asnBoxItem);
|
|
|
+ }
|
|
|
+ asnBoxMain.setIT_ASN_PACK(IT_ASN_PACK);
|
|
|
+ //asnMain.setSUPPLIER_CODE("108207");
|
|
|
+ data.put("data", asnBoxMain);
|
|
|
+ EDIX5JsonHttpClient edix5JsonHttpClient = new EDIX5JsonHttpClient(xmediConfiguration.getX5appid(), xmediConfiguration.getX5appkey(), xmediConfiguration.getX5createAsnBoxUrl());
|
|
|
+ X5Response<Object> createAsn = edix5JsonHttpClient.post(data, xmediConfiguration, baseDao, "CreateAsn");
|
|
|
+ result.put("header", createAsn.getHeader());
|
|
|
+ result.put("body", createAsn.getBody());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
public static String unescapeJsonWithJackson(String jsonString) {
|