Explorar el Código

新增exe1-7实体 map 添加swagger包

11816 hace 2 semanas
padre
commit
591d8f71d0

+ 0
- 108
src/main/java/com/example/backend/pAndSExe/controller/InfExe1Controller.java Ver fichero

@@ -1,108 +0,0 @@
1
-package com.example.backend.pAndSExe.controller;
2
-
3
-import org.springframework.web.bind.annotation.RequestMapping;
4
-import org.springframework.web.bind.annotation.RestController;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.web.bind.annotation.RequestMapping;
7
-import org.springframework.web.bind.annotation.RestController;
8
-import org.springframework.web.bind.annotation.RequestMethod;
9
-
10
-import javax.servlet.http.HttpServletRequest;
11
-
12
-import com.shinsoft.tools.JSONTools;
13
-import com.shinsoft.tools.ExceptionTools;
14
-import com.shinsoft.ctc.salCon.tools.ResultJSON;
15
-import com.shinsoft.ctc.salCon.tools.ResponseCodeMsg;
16
-import com.alibaba.fastjson.JSON;
17
-
18
-import com.example.backend.pAndSExe.service.InfExe1Service;
19
-
20
-/**
21
- * 采销执行库存信息表(InfExe1)表控制层
22
- *
23
- * @author wanyushuai
24
- * @since 2025-12-05 16:52:24
25
- */
26
-@RestController
27
-@RequestMapping("/InfExe1")
28
-public class InfExe1Controller {
29
-
30
-
31
-    @Autowired
32
-    private InfExe1Service infExe1Service;
33
-
34
-    String result;
35
-
36
-
37
-    @RequestMapping(value = "/query")
38
-    public String query(int page, int rows, String params, HttpServletRequest request) {
39
-        try {
40
-            String userId = request.getHeader("userId");
41
-            String userName = request.getHeader("userName");
42
-            result = infExe1Service.query(page, rows, params);
43
-        } catch (Exception ex) {
44
-            ex.printStackTrace();
45
-            result = JSON.toJSONString(new ResultJSON(ResponseCodeMsg.CODE_EX, ex.getMessage(), null));
46
-        } finally {
47
-            return result;
48
-        }
49
-    }
50
-
51
-    @RequestMapping(value = "/queryByPK")
52
-    public String queryByPK(String id, HttpServletRequest request) {
53
-        try {
54
-            String userId = request.getHeader("userId");
55
-            String userName = request.getHeader("userName");
56
-            result = infExe1Service.queryByPK(id);
57
-        } catch (Exception ex) {
58
-            ex.printStackTrace();
59
-            result = JSON.toJSONString(new ResultJSON(ResponseCodeMsg.CODE_EX, ex.getMessage(), null));
60
-        } finally {
61
-            return result;
62
-        }
63
-    }
64
-
65
-    @RequestMapping(value = "/save", method = RequestMethod.POST)
66
-    public String save(String json, HttpServletRequest request) {
67
-        try {
68
-            String userId = request.getHeader("userId");
69
-            String userName = request.getHeader("userName");
70
-            result = infExe1Service.save(userId, userName, json);
71
-        } catch (Exception ex) {
72
-            result = JSON.toJSONString(new ResultJSON(ResponseCodeMsg.CODE_EX, ex.getMessage(), null));
73
-            ex.printStackTrace();
74
-        } finally {
75
-            return result;
76
-        }
77
-    }
78
-
79
-    @RequestMapping(value = "/remove", method = RequestMethod.POST)
80
-    public String remove(String id, HttpServletRequest request) {
81
-        try {
82
-            String userId = request.getHeader("userId");
83
-            String userName = request.getHeader("userName");
84
-            result = infExe1Service.remove(userId, userName, id);
85
-        } catch (Exception ex) {
86
-            ex.printStackTrace();
87
-            result = JSON.toJSONString(new ResultJSON(ResponseCodeMsg.CODE_EX, ex.getMessage(), null));
88
-        } finally {
89
-            return result;
90
-        }
91
-    }
92
-
93
-    @RequestMapping(value = "/removeBatch", method = RequestMethod.POST)
94
-    public String removeBatch(String ids, HttpServletRequest request) {
95
-        try {
96
-            String userId = request.getHeader("userId");
97
-            String userName = request.getHeader("userName");
98
-            result = infExe1Service.removeBatch(userId, userName, ids);
99
-        } catch (Exception ex) {
100
-            ex.printStackTrace();
101
-            result = JSON.toJSONString(new ResultJSON(ResponseCodeMsg.CODE_EX, ex.getMessage(), null));
102
-        } finally {
103
-            return result;
104
-        }
105
-    }
106
-
107
-}
108
-

+ 0
- 29
src/main/java/com/example/backend/pAndSExe/service/InfExe1Service.java Ver fichero

@@ -1,29 +0,0 @@
1
-package com.example.backend.pAndSExe.service;
2
-
3
-import com.example.backend.pAndSExe.model.InfExe1;
4
-import com.baomidou.mybatisplus.extension.service.IService;
5
-
6
-/**
7
- * 采销执行库存信息表业务接口
8
- */
9
-public interface InfExe1Service extends IService
10
-
11
-        <InfExe1> {
12
-    // 根据页码、每页行数和参数查询数据
13
-    String query(int page, int rows, String params);
14
-
15
-    // 根据主键查询
16
-    String queryByPK(String id);
17
-
18
-    // 保存用户信息
19
-    // 参数:userId:用户ID,json:用户信息
20
-    String save(String userId, String userName, String json);
21
-
22
-    // 根据用户ID和ID删除字符串
23
-    String remove(String userId, String userName, String s);
24
-
25
-    // 根据用户ID和ID列表批量删除数据
26
-    String removeBatch(String userId, String userName, String ids);
27
-}
28
-
29
-

+ 0
- 118
src/main/java/com/example/backend/pAndSExe/service/impl/InfExe1ServiceImpl.java Ver fichero

@@ -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
-

Loading…
Cancelar
Guardar