|
@@ -42,6 +42,8 @@ public class StoreServiceImpl implements StoreService {
|
42
|
42
|
public StackMapper stackMapper;
|
43
|
43
|
@Autowired//自动注入Mapper
|
44
|
44
|
public MoveRecordMapper moveRecordMapper;
|
|
45
|
+ @Autowired//自动注入Mapper
|
|
46
|
+ public CustomerMapper customerMapper;
|
45
|
47
|
String result = Type.FAIL;
|
46
|
48
|
int num = 0;
|
47
|
49
|
|
|
@@ -249,7 +251,8 @@ public class StoreServiceImpl implements StoreService {
|
249
|
251
|
// }
|
250
|
252
|
|
251
|
253
|
@Override
|
252
|
|
- public String changeStack(String json,String newWare,String newStack,String newRemark1,String userId,String belongId) {
|
|
254
|
+ public String changeStack(String json,String newWare,String newStack,String newRemark1,
|
|
255
|
+ String newRemark,String userId,String belongId) {
|
253
|
256
|
List<Store> listStore = JSON.parseObject(json, new TypeReference<List<Store>>() {});
|
254
|
257
|
|
255
|
258
|
int layerNew = 0;
|
|
@@ -293,11 +296,48 @@ public class StoreServiceImpl implements StoreService {
|
293
|
296
|
listStore.get(i).setRemark1(newRemark1);
|
294
|
297
|
}
|
295
|
298
|
}
|
|
299
|
+ if (!newRemark.equals("") && newRemark!=null){
|
|
300
|
+ if (newRemark.equals("0")){
|
|
301
|
+ listStore.get(i).setRemark("");
|
|
302
|
+ }else {
|
|
303
|
+ listStore.get(i).setRemark(newRemark);
|
|
304
|
+ }
|
|
305
|
+ }
|
296
|
306
|
num = storeMapper.updateByPrimaryKey(listStore.get(i));
|
297
|
307
|
}
|
298
|
308
|
return result;
|
299
|
309
|
}
|
300
|
310
|
|
|
311
|
+ @Override
|
|
312
|
+ public String changeCustName(String json,String newCustomername,String newFKCustomername,
|
|
313
|
+ String userId,String belongId) {
|
|
314
|
+ List<Store> listStore = JSON.parseObject(json, new TypeReference<List<Store>>() {});
|
|
315
|
+
|
|
316
|
+ int layerNew = 0;
|
|
317
|
+ int layerOld = 0;
|
|
318
|
+ int layer = 0;
|
|
319
|
+ Customer customer = new Customer();
|
|
320
|
+ Customer fkcustomer = new Customer();
|
|
321
|
+ if (!newCustomername.equals("") && newCustomername!=null){
|
|
322
|
+ customer = customerMapper.selectByName(newCustomername,belongId);
|
|
323
|
+ }
|
|
324
|
+ if (!newFKCustomername.equals("") && newFKCustomername!=null){
|
|
325
|
+ fkcustomer = customerMapper.selectByName(newFKCustomername,belongId);
|
|
326
|
+ }
|
|
327
|
+ for (int i = 0; i < listStore.size(); i++) {
|
|
328
|
+ if (!newCustomername.equals("") && newCustomername!=null){
|
|
329
|
+ listStore.get(i).setCustomer(customer);
|
|
330
|
+ num = storeMapper.updateByPrimaryKey(listStore.get(i));
|
|
331
|
+ }
|
|
332
|
+ if (!newFKCustomername.equals("") && newFKCustomername!=null){
|
|
333
|
+ listStore.get(i).setFkComponyId(fkcustomer.getId());
|
|
334
|
+ num = storeMapper.updateFkById(listStore.get(i));
|
|
335
|
+ }
|
|
336
|
+
|
|
337
|
+ }
|
|
338
|
+ return result;
|
|
339
|
+ }
|
|
340
|
+
|
301
|
341
|
private MoveRecord getMoveRecord(Store store, Stack fromStack, Stack toStack, int layerNew, int layerOld, String userId) {
|
302
|
342
|
MoveRecord moveRecord = new MoveRecord();
|
303
|
343
|
moveRecord.setWareNameOld(fromStack.getWare().getName());
|