|
@@ -143,7 +143,8 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
new Thread( new Runnable() {
|
|
new Thread( new Runnable() {
|
|
public void run(){
|
|
public void run(){
|
|
try {
|
|
try {
|
|
- newFileTool.newFile(mapVal.toString(),"物流金蝶订单操作");
|
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject(mapVal);
|
|
|
|
+ newFileTool.newFile(jsonObject.toString(),"物流金蝶订单操作");
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
@@ -320,27 +321,30 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
BigDecimal saleOrderId = amsSaleOrder.getSaleOrderId();
|
|
BigDecimal saleOrderId = amsSaleOrder.getSaleOrderId();
|
|
try {
|
|
try {
|
|
Map<String, Object> saleOrderData = amsSaleOrderMapper.getSaleOrderData(saleOrderId);
|
|
Map<String, Object> saleOrderData = amsSaleOrderMapper.getSaleOrderData(saleOrderId);
|
|
- String carrierName = (String) saleOrderData.get("carrierName");
|
|
|
|
- String saleOrderNo = (String) saleOrderData.get("saleOrderNo");
|
|
|
|
- if (carrierName.equals("自提")||carrierName.isEmpty()){
|
|
|
|
- }else {
|
|
|
|
- //收集发布信息内容
|
|
|
|
- Map<String,Object> dilNotice=new HashMap<>();
|
|
|
|
- //主键ID
|
|
|
|
- BigDecimal noticeId=amsSaleOrderMapper.selectNoticeId();
|
|
|
|
- dilNotice.put("noticeId",noticeId);
|
|
|
|
- //发布人
|
|
|
|
- dilNotice.put("insertUsername","销售审核");
|
|
|
|
- //发布内容
|
|
|
|
- dilNotice.put("noticeContent",saleOrderNo+"已审核");
|
|
|
|
- //发布时间
|
|
|
|
- dilNotice.put("insertTime",new Date());
|
|
|
|
- //新增发布
|
|
|
|
- amsSaleOrderMapper.insertDilNotice(dilNotice);
|
|
|
|
- //根据承运商的名字
|
|
|
|
- carrierName="%"+carrierName+"%";
|
|
|
|
- amsSaleOrderMapper.insertIntoNoticeUser(noticeId,carrierName);
|
|
|
|
|
|
+ if(saleOrderData != null) {
|
|
|
|
+ String carrierName = (String) saleOrderData.get("carrierName");
|
|
|
|
+ String saleOrderNo = (String) saleOrderData.get("saleOrderNo");
|
|
|
|
+ if (carrierName.equals("自提")||carrierName.isEmpty()){
|
|
|
|
+ }else {
|
|
|
|
+ //收集发布信息内容
|
|
|
|
+ Map<String,Object> dilNotice=new HashMap<>();
|
|
|
|
+ //主键ID
|
|
|
|
+ BigDecimal noticeId=amsSaleOrderMapper.selectNoticeId();
|
|
|
|
+ dilNotice.put("noticeId",noticeId);
|
|
|
|
+ //发布人
|
|
|
|
+ dilNotice.put("insertUsername","销售审核");
|
|
|
|
+ //发布内容
|
|
|
|
+ dilNotice.put("noticeContent",saleOrderNo+"已审核");
|
|
|
|
+ //发布时间
|
|
|
|
+ dilNotice.put("insertTime",new Date());
|
|
|
|
+ //新增发布
|
|
|
|
+ amsSaleOrderMapper.insertDilNotice(dilNotice);
|
|
|
|
+ //根据承运商的名字
|
|
|
|
+ carrierName="%"+carrierName+"%";
|
|
|
|
+ amsSaleOrderMapper.insertIntoNoticeUser(noticeId,carrierName);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
@@ -527,6 +531,50 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
amsSaleMaterial.setMaterialNumber(new BigDecimal(materialNumber));
|
|
amsSaleMaterial.setMaterialNumber(new BigDecimal(materialNumber));
|
|
amsSaleMaterial.setMaterialPlanNumber(new BigDecimal(materialNumber));
|
|
amsSaleMaterial.setMaterialPlanNumber(new BigDecimal(materialNumber));
|
|
}
|
|
}
|
|
|
|
+ try {
|
|
|
|
+ amsSaleMaterial.setTransferInOfWarehouse(saleRemark);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ if(isWagon != null && (Boolean) isWagon && saleRemark != null) {
|
|
|
|
+ //如果是车皮就截取摘要里面的
|
|
|
|
+ //设置到站
|
|
|
|
+ Object toTheStation = saleRemark;
|
|
|
|
+ if(saleRemark.split("直发")[1] != null) {
|
|
|
|
+ toTheStation = saleRemark.split("直发")[1];
|
|
|
|
+ }
|
|
|
|
+ TmstrainPleaseApproveResult tmstrainPleaseApproveResult=new TmstrainPleaseApproveResult();
|
|
|
|
+ BigDecimal maxId = tmstrainPleaseApproveResultMapper.getMaxId();
|
|
|
|
+ tmstrainPleaseApproveResult.setResultId(maxId);
|
|
|
|
+ tmstrainPleaseApproveResult.setResultPleasePlanNo(DataChange.generateEightDigitsNumber("WLQCH",maxId.intValue()));
|
|
|
|
+ tmstrainPleaseApproveResult.setRailPlanId(saleMaterialId);
|
|
|
|
+ //查找到站是否存在到站表
|
|
|
|
+ BigDecimal sendStation = rmstrainArrivalSendMapper.getSendStation((String) toTheStation);
|
|
|
|
+ //到站不存在
|
|
|
|
+ if (sendStation==null){
|
|
|
|
+ //新增到站
|
|
|
|
+ BigDecimal toStationMaxId = rmstrainArrivalSendMapper.getMaxId();
|
|
|
|
+ RmstrainArrivalSend rmstrainArrivalSend=new RmstrainArrivalSend();
|
|
|
|
+ rmstrainArrivalSend.setArrivalId(toStationMaxId);
|
|
|
|
+ rmstrainArrivalSend.setArrivalName((String) toTheStation);
|
|
|
|
+ rmstrainArrivalSend.setInsertTime(new Date());
|
|
|
|
+ rmstrainArrivalSend.setInsertUsername("金蝶");
|
|
|
|
+ rmstrainArrivalSend.setInsertUpdateRemark("金蝶回传数据");
|
|
|
|
+ result += rmstrainArrivalSendMapper.insertSelective(rmstrainArrivalSend);
|
|
|
|
+ tmstrainPleaseApproveResult.setToTheStationId(toStationMaxId);
|
|
|
|
+ }else {
|
|
|
|
+ //到站存在
|
|
|
|
+ tmstrainPleaseApproveResult.setToTheStationId(sendStation);
|
|
|
|
+ }
|
|
|
|
+ tmstrainPleaseApproveResult.setResultType(new BigDecimal(4));
|
|
|
|
+ tmstrainPleaseApproveResult.setInsertTime(new Date());
|
|
|
|
+ tmstrainPleaseApproveResult.setInsertUpdateRemark("金蝶回传");
|
|
|
|
+ result += tmstrainPleaseApproveResultMapper.insertSelective(tmstrainPleaseApproveResult);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
result += amsSaleMaterialMapper.insertSelective(amsSaleMaterial);
|
|
result += amsSaleMaterialMapper.insertSelective(amsSaleMaterial);
|
|
}
|
|
}
|
|
result += amsSaleOrderMapper.insertSelective(amsSaleOrder);
|
|
result += amsSaleOrderMapper.insertSelective(amsSaleOrder);
|
|
@@ -641,6 +689,46 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+ try {
|
|
|
|
+ if(isWagon != null && (Boolean) isWagon && saleRemark != null) {
|
|
|
|
+ //如果是车皮就截取摘要里面的
|
|
|
|
+ //设置到站
|
|
|
|
+ tmstrainPleaseApproveResultMapper.deleteByAsmId(amsSaleMaterial.getSaleMaterialId());
|
|
|
|
+ Object toTheStation = saleRemark;
|
|
|
|
+ if(saleRemark.split("直发")[1] != null) {
|
|
|
|
+ toTheStation = saleRemark.split("直发")[1];
|
|
|
|
+ }
|
|
|
|
+ TmstrainPleaseApproveResult tmstrainPleaseApproveResult=new TmstrainPleaseApproveResult();
|
|
|
|
+ BigDecimal maxId = tmstrainPleaseApproveResultMapper.getMaxId();
|
|
|
|
+ tmstrainPleaseApproveResult.setResultId(maxId);
|
|
|
|
+ tmstrainPleaseApproveResult.setResultPleasePlanNo(DataChange.generateEightDigitsNumber("WLQCH",maxId.intValue()));
|
|
|
|
+ tmstrainPleaseApproveResult.setRailPlanId(amsSaleMaterial.getSaleMaterialId());
|
|
|
|
+ //查找到站是否存在到站表
|
|
|
|
+ BigDecimal sendStation = rmstrainArrivalSendMapper.getSendStation((String) toTheStation);
|
|
|
|
+ //到站不存在
|
|
|
|
+ if (sendStation==null){
|
|
|
|
+ //新增到站
|
|
|
|
+ BigDecimal toStationMaxId = rmstrainArrivalSendMapper.getMaxId();
|
|
|
|
+ RmstrainArrivalSend rmstrainArrivalSend=new RmstrainArrivalSend();
|
|
|
|
+ rmstrainArrivalSend.setArrivalId(toStationMaxId);
|
|
|
|
+ rmstrainArrivalSend.setArrivalName((String) toTheStation);
|
|
|
|
+ rmstrainArrivalSend.setInsertTime(new Date());
|
|
|
|
+ rmstrainArrivalSend.setInsertUsername("金蝶");
|
|
|
|
+ rmstrainArrivalSend.setInsertUpdateRemark("金蝶回传数据");
|
|
|
|
+ result += rmstrainArrivalSendMapper.insertSelective(rmstrainArrivalSend);
|
|
|
|
+ tmstrainPleaseApproveResult.setToTheStationId(toStationMaxId);
|
|
|
|
+ }else {
|
|
|
|
+ //到站存在
|
|
|
|
+ tmstrainPleaseApproveResult.setToTheStationId(sendStation);
|
|
|
|
+ }
|
|
|
|
+ tmstrainPleaseApproveResult.setResultType(new BigDecimal(4));
|
|
|
|
+ tmstrainPleaseApproveResult.setInsertTime(new Date());
|
|
|
|
+ tmstrainPleaseApproveResult.setInsertUpdateRemark("金蝶回传");
|
|
|
|
+ result += tmstrainPleaseApproveResultMapper.insertSelective(tmstrainPleaseApproveResult);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
result += amsSaleMaterialMapper.updateByPrimaryKeySelective(amsSaleMaterial);
|
|
result += amsSaleMaterialMapper.updateByPrimaryKeySelective(amsSaleMaterial);
|
|
}
|
|
}
|
|
if(amsSaleOrder.getSaleType() != null && amsSaleOrder.getSaleType().intValue() == 1 && EasIds.size() < wuliuStIds.size()){
|
|
if(amsSaleOrder.getSaleType() != null && amsSaleOrder.getSaleType().intValue() == 1 && EasIds.size() < wuliuStIds.size()){
|