|
@@ -5,9 +5,11 @@ import com.alibaba.fastjson.TypeReference;
|
5
|
5
|
import com.github.pagehelper.PageHelper;
|
6
|
6
|
import com.github.pagehelper.PageInfo;
|
7
|
7
|
import com.th.demo.mapping.maint.CustomerMapper;
|
|
8
|
+import com.th.demo.mapping.maint.MaterialMapper;
|
8
|
9
|
import com.th.demo.mapping.maint.StackMapper;
|
9
|
10
|
import com.th.demo.mapping.ware.*;
|
10
|
11
|
import com.th.demo.model.maint.Customer;
|
|
12
|
+import com.th.demo.model.maint.Material;
|
11
|
13
|
import com.th.demo.model.maint.Stack;
|
12
|
14
|
import com.th.demo.model.system.SysUser;
|
13
|
15
|
import com.th.demo.model.system.Type;
|
|
@@ -43,6 +45,8 @@ public class StoreServiceImpl implements StoreService {
|
43
|
45
|
public StackMapper stackMapper;
|
44
|
46
|
@Autowired//自动注入Mapper
|
45
|
47
|
public DistributionDetailMapper distributionDetailMapper;
|
|
48
|
+ @Autowired//自动注入Mapper
|
|
49
|
+ public MaterialMapper materialMapper;
|
46
|
50
|
String result = Type.FAIL;
|
47
|
51
|
int num = 0;
|
48
|
52
|
|
|
@@ -77,7 +81,29 @@ public class StoreServiceImpl implements StoreService {
|
77
|
81
|
@Override
|
78
|
82
|
public String modify(String json, String userId, String belongId) {
|
79
|
83
|
Store store = JSON.parseObject(json,Store.class);
|
80
|
|
- int num =storeMapper.updateByPrimaryKey(store);
|
|
84
|
+ Store new_store = storeMapper.selectByPrimaryKey(store.getId());
|
|
85
|
+ Material material = materialMapper.selectByPrimaryKey(store.getMaterial().getId());
|
|
86
|
+ Customer customer = customerMapper.selectByName(store.getCustomer().getName(),store.getBelongId());
|
|
87
|
+ Customer fk_customer = customerMapper.selectByName(store.getFkCustomerName(),store.getBelongId());
|
|
88
|
+
|
|
89
|
+ new_store.setMaterial(material);
|
|
90
|
+ new_store.setModel(store.getModel());
|
|
91
|
+ new_store.setCount(store.getCount());
|
|
92
|
+ new_store.setWeight(store.getWeight());
|
|
93
|
+ new_store.setPlateNo(store.getPlateNo());
|
|
94
|
+ new_store.setOrdNo(store.getOrdNo());
|
|
95
|
+ new_store.setContractNo(store.getContractNo());
|
|
96
|
+ new_store.setPackNo(store.getPackNo());
|
|
97
|
+ new_store.setProductionPlace(store.getProductionPlace());
|
|
98
|
+ new_store.setReceiveAddress(store.getReceiveAddress());
|
|
99
|
+ new_store.setRemark(store.getRemark());
|
|
100
|
+
|
|
101
|
+ new_store.setCustomer(customer);
|
|
102
|
+ new_store.setFkComponyId(fk_customer.getId());
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+ int num =storeMapper.updateByPrimaryKey(new_store);
|
|
106
|
+ num =storeMapper.updateFKByPKey(new_store);
|
81
|
107
|
result=Tools.moreThanZeroResultJSON(num);
|
82
|
108
|
return result;
|
83
|
109
|
}
|