|
@@ -90,7 +90,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
private IDxpDataPlanService dxpDataPlanService;
|
|
|
|
|
|
/**
|
|
|
- * 添加
|
|
|
+ * 通过参照出运明细添加数据 添加方式1
|
|
|
* @param syPackingListFabric
|
|
|
* @return
|
|
|
*/
|
|
@@ -122,9 +122,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
SyShippingDetailsItem detailsItem=syShippingDetailsItemMapper.selectById(entity.getSyShippingDetailsItemId());
|
|
|
//detailsItem.setIsReference(1);//修改成已被参照
|
|
|
//剩余数量-这次入库数量=新剩余数量
|
|
|
- detailsItem.setSurplusQuantity(detailsItem.getSurplusQuantity().subtract(entity.getInventoryQuantity()));
|
|
|
+ detailsItem.setOrderRemainingQuantity(detailsItem.getOrderRemainingQuantity().subtract(entity.getInventoryQuantity()));
|
|
|
//此次入库数量-剩余数量=超发数量
|
|
|
- detailsItem.setExcessQuantity(entity.getInventoryQuantity().subtract(detailsItem.getSurplusQuantity()));
|
|
|
+ detailsItem.setExcessQuantity(entity.getInventoryQuantity().subtract(detailsItem.getOrderRemainingQuantity()));
|
|
|
detailsItem.setIsReference(2);//面辅料回写
|
|
|
entity.setSalesman(detailsItem.getSalesman());//获取业务员
|
|
|
entity.setSalesDepartment(detailsItem.getSalesDepartment());//获取业务部门
|
|
@@ -171,7 +171,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ * 增删改都会调用的方法,用来计算剩余数量和超发数量
|
|
|
* @param quantity 本次数量
|
|
|
* @param syShippingDetailsItemId 出运明细id
|
|
|
* @return
|
|
@@ -181,7 +181,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
queryWrapper.eq("sy_shipping_details_item_id", syShippingDetailsItemId);//出运明细id
|
|
|
queryWrapper.eq("del_flag", "0");//未删除
|
|
|
queryWrapper.select("sum(actual_Declared_Quantity) as actualDeclaredQuantity");//获取实际报关数量合计
|
|
|
- BigDecimal actualDeclaredQuantity=syPackingListFabricItemMapper.selectOne(queryWrapper).getActualDeclaredQuantity();
|
|
|
+ BigDecimal actualDeclaredQuantity=new BigDecimal("0");
|
|
|
+ if(syPackingListFabricItemMapper.selectOne(queryWrapper)!=null){
|
|
|
+ actualDeclaredQuantity=syPackingListFabricItemMapper.selectOne(queryWrapper).getActualDeclaredQuantity();
|
|
|
+ }
|
|
|
actualDeclaredQuantity.add(quantity);
|
|
|
|
|
|
QueryWrapper queryWrapper2=new QueryWrapper();
|
|
@@ -194,9 +197,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
BigDecimal excessQuantity=null;//超发数量
|
|
|
if(actualDeclaredQuantity.doubleValue()>shipmentQuantity.doubleValue()){
|
|
|
excessQuantity=actualDeclaredQuantity.subtract(shipmentQuantity);
|
|
|
- }
|
|
|
- if(excessQuantity.doubleValue()<=0){
|
|
|
- excessQuantity=null;//转为null
|
|
|
+ if(excessQuantity.doubleValue()<=0){
|
|
|
+ excessQuantity=null;//转为null
|
|
|
+ }
|
|
|
}
|
|
|
UpdateWrapper updateWrapper=new UpdateWrapper();
|
|
|
updateWrapper.set("remaining_Quantity",remainingQuantity);
|
|
@@ -205,6 +208,12 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
return syPackingListFabricItemMapper.update(null,updateWrapper);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 通过主页的编辑来修改数据
|
|
|
+ * @param syPackingListFabric
|
|
|
+ * @param syPackingListFabricItemList
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public SyPackingListFabric updateMain(SyPackingListFabric syPackingListFabric,List<SyPackingListFabricItem> syPackingListFabricItemList) {
|
|
@@ -242,9 +251,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
//因为云工场得修改时得停止调用前面接口
|
|
|
/*SyShippingDetailsItem s1 =syShippingDetailsItemMapper.selectById(entity.getSyShippingDetailsItemId());
|
|
|
//剩余数量-这次入库数量=新剩余数量
|
|
|
- s1.setSurplusQuantity(s1.getSurplusQuantity().subtract(entity.getInventoryQuantity()));
|
|
|
+ s1.setOrderRemainingQuantity(s1.getOrderRemainingQuantity().subtract(entity.getInventoryQuantity()));
|
|
|
//此次入库数量-剩余数量=超发数量
|
|
|
- s1.setExcessQuantity(entity.getInventoryQuantity().subtract(s1.getSurplusQuantity()));
|
|
|
+ s1.setExcessQuantity(entity.getInventoryQuantity().subtract(s1.getOrderRemainingQuantity()));
|
|
|
syShippingDetailsItemMapper.updateById(s1);
|
|
|
entity.setTotalPrice(entity.getActualDeclaredQuantity().multiply(entity.getPrice()));//实际报关数量*单价
|
|
|
if((entity.getInventoryCcode().indexOf("03")!=-1&&!entity.getInventoryCcode().equals("0399")) ||
|
|
@@ -272,6 +281,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
return syPackingListFabric;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除 将del_flag改为1
|
|
|
+ * @param id
|
|
|
+ */
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void delMain(String id) {
|
|
@@ -285,6 +298,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
syPackingListFabricMapper.deleteByMainId(id);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量删除 将del_flag改为1
|
|
|
+ * @param idList
|
|
|
+ */
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void delBatchMain(Collection<? extends Serializable> idList) {
|
|
@@ -300,11 +317,22 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据条件查询发运明细
|
|
|
+ * @param page
|
|
|
+ * @param queryWrapper
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public IPage<SyShippingDetailsVo> queryShippingDetails(IPage<SyShippingDetailsVo> page, QueryWrapper<SyShippingDetailsVo> queryWrapper) {
|
|
|
return syPackingListFabricMapper.queryShippingDetails(page,queryWrapper);//查询发运明细
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 暂时没用到
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public List<SyPackingListFabric> getSyShippingDetailsDatas(String[] ids) {
|
|
|
/* SyPackingListFabric syPackingListFabricList=syPackingListFabricMapper.getSyShippingDetailsData(ids);
|
|
@@ -318,7 +346,13 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
|
|
|
|
|
|
- //可能会获取多条数据头表数据,头表不知选那条数据
|
|
|
+ /**
|
|
|
+ * 选中出运明细后,根据主表id和分组id查询出对应的数据
|
|
|
+ * @param ids
|
|
|
+ * @param groupIds
|
|
|
+ * @return
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
@Override
|
|
|
public SyPackingListFabric getSyShippingDetailsData(String[] ids,String [] groupIds) throws ParseException {
|
|
|
String time= new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis());
|
|
@@ -341,6 +375,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
return syPackingListFabric;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据主表id查询该单据的所有数据
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public SyPackingListFabric selectById(String id) {
|
|
|
SyPackingListFabric syPackingListFabric= syPackingListFabricMapper.selectById(id);
|
|
@@ -348,7 +387,13 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
return syPackingListFabric;
|
|
|
}
|
|
|
|
|
|
- //面辅料导出,集装箱号、外销发票号相同进行合并
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 面辅料导出,集装箱号、外销发票号相同合并为sheetName
|
|
|
+ * @param page
|
|
|
+ * @param queryWrapper
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public List<SyPackingListFabric> selectByList(IPage<SyPackingListFabric> page,QueryWrapper<SyPackingListFabric> queryWrapper) {
|
|
|
//传搜索条件
|
|
@@ -389,12 +434,22 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
return arrayLists;
|
|
|
}
|
|
|
|
|
|
- //主页查询
|
|
|
+ /**
|
|
|
+ * 分页查询
|
|
|
+ * @param page
|
|
|
+ * @param queryWrapper
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public IPage<SyPackingListFabric> selectPage(IPage<SyPackingListFabric> page, QueryWrapper<SyPackingListFabric> queryWrapper) {
|
|
|
return syPackingListFabricMapper.queryMain(page,queryWrapper);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量提交
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public boolean submitBatch(String[] ids) {
|
|
@@ -414,6 +469,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量取消提交
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public String cancelSubmitBatch(String[] ids) {
|
|
@@ -446,7 +506,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
|
|
|
/***
|
|
|
- * 云工厂
|
|
|
+ * 云工厂推送过来的接口 添加方式2
|
|
|
* @param syPackingListTailorings
|
|
|
*/
|
|
|
@Override
|
|
@@ -467,8 +527,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
syPackingListFabric.setStatus("0");
|
|
|
syPackingListFabric.setDelFlag("0");
|
|
|
syPackingListFabricMapper.insert(syPackingListFabric);
|
|
|
- //客户名
|
|
|
- //客户简称
|
|
|
for (SyPackingListFabricItem s1 : syPackingListFabric.getSyPackingListFabricItem()) {
|
|
|
s1.setId(null);
|
|
|
s1.setDelFlag("0");
|
|
@@ -530,10 +588,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
s1.setSpecificationAndModel(item.getSpecificationAndModel());//规格型号
|
|
|
|
|
|
if(s1.getActualDeclaredQuantity()!=null){
|
|
|
- s1.setExcessQuantity(s1.getActualDeclaredQuantity().subtract(item.getSurplusQuantity()));//超发数量
|
|
|
- s1.setSurplusQuantity(item.getSurplusQuantity().subtract(s1.getActualDeclaredQuantity()).intValue());//剩余数量
|
|
|
- item.setExcessQuantity(s1.getActualDeclaredQuantity().subtract(item.getSurplusQuantity()));
|
|
|
- item.setSurplusQuantity(item.getSurplusQuantity().subtract(s1.getActualDeclaredQuantity()));
|
|
|
+ s1.setExcessQuantity(s1.getActualDeclaredQuantity().subtract(item.getOrderRemainingQuantity()));//超发数量
|
|
|
+ s1.setRemainingQuantity(item.getOrderRemainingQuantity().subtract(s1.getActualDeclaredQuantity()));//剩余数量
|
|
|
+ item.setExcessQuantity(s1.getActualDeclaredQuantity().subtract(item.getOrderRemainingQuantity()));
|
|
|
+ item.setOrderRemainingQuantity(item.getOrderRemainingQuantity().subtract(s1.getActualDeclaredQuantity()));
|
|
|
updateQuantity(s1.getActualDeclaredQuantity(),s1.getSyShippingDetailsItemId());
|
|
|
}
|
|
|
item.setIsReference(2);
|
|
@@ -554,7 +612,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * excel导入
|
|
|
+ * excel导入 添加方式3
|
|
|
* @param maps
|
|
|
* @return
|
|
|
*/
|
|
@@ -639,10 +697,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
|
|
|
}
|
|
|
if(item.getActualDeclaredQuantity()!=null){//计算超发和剩余数量
|
|
|
- item.setExcessQuantity(item.getActualDeclaredQuantity().subtract(syShippingDetailsItem.getSurplusQuantity()));//超发数量
|
|
|
- item.setSurplusQuantity(syShippingDetailsItem.getSurplusQuantity().subtract(item.getActualDeclaredQuantity()).intValue());//剩余数量
|
|
|
- syShippingDetailsItem.setExcessQuantity(item.getActualDeclaredQuantity().subtract(syShippingDetailsItem.getSurplusQuantity()));
|
|
|
- syShippingDetailsItem.setSurplusQuantity(syShippingDetailsItem.getSurplusQuantity().subtract(item.getActualDeclaredQuantity()));
|
|
|
+ item.setExcessQuantity(item.getActualDeclaredQuantity().subtract(syShippingDetailsItem.getOrderRemainingQuantity()));//超发数量
|
|
|
+ item.setRemainingQuantity(syShippingDetailsItem.getOrderRemainingQuantity().subtract(item.getActualDeclaredQuantity()));//剩余数量
|
|
|
+ syShippingDetailsItem.setExcessQuantity(item.getActualDeclaredQuantity().subtract(syShippingDetailsItem.getOrderRemainingQuantity()));
|
|
|
+ syShippingDetailsItem.setOrderRemainingQuantity(syShippingDetailsItem.getOrderRemainingQuantity().subtract(item.getActualDeclaredQuantity()));
|
|
|
syShippingDetailsItem.setIsReference(2);//回写
|
|
|
syShippingDetailsItemMapper.updateById(syShippingDetailsItem);
|
|
|
updateQuantity(item.getActualDeclaredQuantity(),item.getSyShippingDetailsItemId());
|
|
@@ -660,6 +718,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
return bool;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * excel导入测试的数据
|
|
|
+ * @param maps
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public String excelTest(Map<String, SyPackingListFabric> maps) {
|
|
|
String strs="";
|
|
@@ -741,7 +804,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
- private SyPackingListTailoringMapper syPackingListTailoringMapper;
|
|
|
+ private SyPackingListTailoringMapper syPackingListTailoringMapper;//成衣mapper
|
|
|
|
|
|
@Autowired
|
|
|
private PurchaseWarehousingMapper purchaseWarehousingMapper;//采购入库表
|
|
@@ -765,7 +828,12 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 推送u8
|
|
|
+ * @param main
|
|
|
+ * @param mapt
|
|
|
+ * @return
|
|
|
+ */
|
|
|
String saveBatch(SyPackingListFabric main,Map<String,Object> mapt){
|
|
|
mapt.put("customerCode","xxx");//进入方法时设置客户编码为空
|
|
|
if(main==null){
|
|
@@ -1267,6 +1335,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 生成txt文件
|
|
|
+ * @param mapList
|
|
|
+ * @param tableName
|
|
|
+ */
|
|
|
public void text(JSONArray mapList,String tableName){
|
|
|
try{
|
|
|
String txtWorld="\n"+((Map)mapList.get(0)).get("CACCID")+"\t"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(System.currentTimeMillis())+"\n\n";
|
|
@@ -1279,6 +1352,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 记录推送u8成功的单据号
|
|
|
+ * @param syPackingListTailoring
|
|
|
+ * @param recording
|
|
|
+ */
|
|
|
public void recording(SyPackingListFabric syPackingListTailoring,String recording){
|
|
|
if(syPackingListTailoring.getRecording()!=null){
|
|
|
String[] recordings=syPackingListTailoring.getRecording().split(",");
|
|
@@ -1305,6 +1383,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 记录推送u8成功的单据号
|
|
|
+ * @param syPackingListTailoring
|
|
|
+ * @param recording
|
|
|
+ */
|
|
|
public void isSucceed(SyPackingListFabric syPackingListTailoring,String recording){
|
|
|
if(syPackingListTailoring.getIsSucceed()!=null){
|
|
|
String[] recordings=syPackingListTailoring.getIsSucceed().split(",");
|
|
@@ -1331,6 +1414,15 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 推送u8
|
|
|
+ * @param main
|
|
|
+ * @param jsonArray
|
|
|
+ * @param tableName
|
|
|
+ * @param account
|
|
|
+ * @param index
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public String result(SyPackingListFabric main,JSONArray jsonArray,String tableName ,String account,String index){
|
|
|
JSONObject jsonObject=jsonArray.getJSONObject(0);
|
|
|
if(jsonObject.get("Result").equals("F")){//获取发货单是否成功添加
|
|
@@ -1339,6 +1431,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
return account+"-"+index+"-"+jsonObject.get("ReceiptNo");//账套号-序号-生成的单号
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取自由项
|
|
|
+ * @param itemMap
|
|
|
+ * @param mapPOPodetails
|
|
|
+ */
|
|
|
public void getcFree(JSONObject itemMap,Map<String,Object> mapPOPodetails){
|
|
|
itemMap.put("CDEFINE22",setNull(mapPOPodetails.get("cDefine22")));
|
|
|
itemMap.put("CDEFINE23",setNull(mapPOPodetails.get("cDefine23")));
|
|
@@ -1376,6 +1473,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 从u8拉取数据 添加方式4
|
|
|
+ * @return
|
|
|
+ */
|
|
|
//@Override
|
|
|
//@Transactional
|
|
|
@Scheduled(fixedRate=1000*60*3)
|
|
@@ -1673,10 +1774,14 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
return "成功添加了"+num+"条数据!";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 判断该字符串是否能转化为数字
|
|
|
+ * @param str
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public static boolean isNumeric(String str) {
|
|
|
- String bigStr;
|
|
|
try {
|
|
|
- bigStr = new BigDecimal(str).toString();
|
|
|
+ String bigStr = new BigDecimal(str).toString();
|
|
|
} catch (Exception e) {
|
|
|
return false;//异常 说明包含非数字。
|
|
|
}
|