|
|
@@ -1,118 +0,0 @@
|
|
1
|
|
-package com.example.backend.pAndSExe.service.impl;
|
|
2
|
|
-
|
|
3
|
|
-import com.example.backend.pAndSExe.model.InfExe1;
|
|
4
|
|
-import com.example.backend.pAndSExe.mapper.InfExe1Mapper;
|
|
5
|
|
-import com.example.backend.pAndSExe.service.InfExe1Service;
|
|
6
|
|
-import com.shinsoft.ctc.salCon.model.Type;
|
|
7
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
8
|
|
-import com.shinsoft.ctc.salCon.tools.JSONTools;
|
|
9
|
|
-import org.springframework.stereotype.Service;
|
|
10
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
11
|
|
-
|
|
12
|
|
-import java.util.Date;
|
|
13
|
|
-import java.util.List;
|
|
14
|
|
-
|
|
15
|
|
-import com.alibaba.fastjson.JSON;
|
|
16
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
17
|
|
-import com.alibaba.fastjson.TypeReference;
|
|
18
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
19
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
20
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
21
|
|
-
|
|
22
|
|
-import java.util.Objects;
|
|
23
|
|
-
|
|
24
|
|
-/**
|
|
25
|
|
- * 采销执行库存信息表 业务实现
|
|
26
|
|
- */
|
|
27
|
|
-@Service
|
|
28
|
|
-public class InfExe1ServiceImpl extends ServiceImpl<InfExe1Mapper, InfExe1> implements InfExe1Service {
|
|
29
|
|
-
|
|
30
|
|
-
|
|
31
|
|
- String result = Type.FAIL;
|
|
32
|
|
- int num = 0;
|
|
33
|
|
-
|
|
34
|
|
- @Autowired
|
|
35
|
|
- InfExe1Mapper infExe1Mapper;
|
|
36
|
|
-
|
|
37
|
|
- @Override
|
|
38
|
|
- public String query(int page, int rows, String params) {
|
|
39
|
|
- JSONObject jsonObject = JSON.parseObject(params);
|
|
40
|
|
- String code = jsonObject.getString("code");
|
|
41
|
|
- String name = jsonObject.getString("name");
|
|
42
|
|
- Page<InfExe1> infExe1Page = new Page<>(page, rows);
|
|
43
|
|
- QueryWrapper<InfExe1> queryWrapper = new QueryWrapper<>();
|
|
44
|
|
- queryWrapper.eq("del_flag", "0");
|
|
45
|
|
- queryWrapper.eq(StringUtils.isNotEmpty(code), "CODE", code);
|
|
46
|
|
- queryWrapper.like(StringUtils.isNotEmpty(name), "NAME", name);
|
|
47
|
|
- queryWrapper.orderByDesc("create_time");
|
|
48
|
|
- Page<InfExe1> list = infExe1Mapper.selectPage(infExe1Page, queryWrapper);
|
|
49
|
|
- result = JSONTools.toStringyyyyMMdd(list);
|
|
50
|
|
- return result;
|
|
51
|
|
- }
|
|
52
|
|
-
|
|
53
|
|
- @Override
|
|
54
|
|
- public String queryByPK(String id) {
|
|
55
|
|
- InfExe1 infExe1 =
|
|
56
|
|
- infExe1Mapper.selectByPK(id);
|
|
57
|
|
- result = JSONTools.toStringyyyyMMdd(infExe1);
|
|
58
|
|
- return result;
|
|
59
|
|
- }
|
|
60
|
|
-
|
|
61
|
|
-
|
|
62
|
|
- @Override
|
|
63
|
|
- public String save(String userId, String userName, String json) {
|
|
64
|
|
- Date date = new Date();
|
|
65
|
|
- InfExe1 infExe1 =
|
|
66
|
|
- JSON.parseObject(json, new TypeReference<InfExe1>() {
|
|
67
|
|
- });
|
|
68
|
|
- if (StringUtils.isEmpty(infExe1.getId())) {
|
|
69
|
|
- infExe1.setDelFlag(0);
|
|
70
|
|
- infExe1.setCreateBy(userId);
|
|
71
|
|
- infExe1.setCreateByName(userName);
|
|
72
|
|
- infExe1.setCreateTime(date);
|
|
73
|
|
- infExe1Mapper.insert(infExe1);
|
|
74
|
|
- } else {
|
|
75
|
|
- infExe1.setUpdateBy(userId);
|
|
76
|
|
- infExe1.setUpdateByName(userName);
|
|
77
|
|
- infExe1.setUpdateTime(date);
|
|
78
|
|
- infExe1Mapper.updateById(infExe1);
|
|
79
|
|
- }
|
|
80
|
|
-
|
|
81
|
|
- result = JSONTools.toStringyyyyMMdd(infExe1);
|
|
82
|
|
- return result;
|
|
83
|
|
- }
|
|
84
|
|
-
|
|
85
|
|
- @Override
|
|
86
|
|
- public String remove(String userId, String userName, String id) {
|
|
87
|
|
- Date date = new Date();
|
|
88
|
|
- InfExe1 infExe1 =
|
|
89
|
|
- infExe1Mapper.selectById(id);
|
|
90
|
|
- infExe1.setDelFlag(1);
|
|
91
|
|
- infExe1.setUpdateBy(userId);
|
|
92
|
|
- infExe1.setUpdateByName(userName);
|
|
93
|
|
- infExe1.setUpdateTime(date);
|
|
94
|
|
- num = infExe1Mapper.updateById(infExe1);
|
|
95
|
|
- result = JSONTools.toString(num);
|
|
96
|
|
- return result;
|
|
97
|
|
- }
|
|
98
|
|
-
|
|
99
|
|
- @Override
|
|
100
|
|
- public String removeBatch(String userId, String userName, String ids) {
|
|
101
|
|
- Date date = new Date();
|
|
102
|
|
- // List<String> list = JSON.parseObject(ids, new TypeReference<List<String>>() {});
|
|
103
|
|
- String[] list = ids.split(",");
|
|
104
|
|
- InfExe1 infExe1;
|
|
105
|
|
- for (String id : list) {
|
|
106
|
|
- infExe1 = infExe1Mapper.selectById(id);
|
|
107
|
|
- infExe1.setDelFlag(1);
|
|
108
|
|
- infExe1.setUpdateBy(userId);
|
|
109
|
|
- infExe1.setUpdateByName(userName);
|
|
110
|
|
- infExe1.setUpdateTime(date);
|
|
111
|
|
- num += infExe1Mapper.updateById(infExe1);
|
|
112
|
|
- }
|
|
113
|
|
- result = JSONTools.toString(num);
|
|
114
|
|
- return result;
|
|
115
|
|
- }
|
|
116
|
|
-
|
|
117
|
|
-}
|
|
118
|
|
-
|