fanxw 1 년 전
부모
커밋
6c8198cb2d

+ 18 - 15
src/main/java/com/chinaitop/depot/business/controller/ReceiveNoticeController.java

@@ -1,13 +1,12 @@
1 1
 package com.chinaitop.depot.business.controller;
2 2
 
3
-import com.chinaitop.depot.business.model.BusinessNoticeReceive;
4
-import com.chinaitop.depot.business.service.ReceiveNoticeService;
5
-import com.chinaitop.depot.business.service.SystemOutsideDataService;
6
-import com.github.pagehelper.PageInfo;
7
-import io.swagger.annotations.Api;
8
-import io.swagger.annotations.ApiImplicitParam;
9
-import io.swagger.annotations.ApiImplicitParams;
10
-import io.swagger.annotations.ApiOperation;
3
+import java.math.BigDecimal;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+
11 10
 import org.slf4j.Logger;
12 11
 import org.slf4j.LoggerFactory;
13 12
 import org.springframework.http.MediaType;
@@ -15,15 +14,17 @@ import org.springframework.util.MultiValueMap;
15 14
 import org.springframework.web.bind.annotation.RequestBody;
16 15
 import org.springframework.web.bind.annotation.RequestMapping;
17 16
 import org.springframework.web.bind.annotation.RequestMethod;
18
-import org.springframework.web.bind.annotation.RequestParam;
19 17
 import org.springframework.web.bind.annotation.RestController;
20 18
 
21
-import javax.annotation.Resource;
19
+import com.chinaitop.depot.business.model.BusinessNoticeReceive;
20
+import com.chinaitop.depot.business.service.ReceiveNoticeService;
21
+import com.chinaitop.depot.business.service.SystemOutsideDataService;
22
+import com.github.pagehelper.PageInfo;
22 23
 
23
-import java.math.BigDecimal;
24
-import java.util.HashMap;
25
-import java.util.List;
26
-import java.util.Map;
24
+import io.swagger.annotations.Api;
25
+import io.swagger.annotations.ApiImplicitParam;
26
+import io.swagger.annotations.ApiImplicitParams;
27
+import io.swagger.annotations.ApiOperation;
27 28
 
28 29
 /**
29 30
  * 接收通知单
@@ -130,7 +131,7 @@ public class ReceiveNoticeController {
130 131
     }
131 132
 
132 133
 	@RequestMapping(value="/updateHtbh", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
133
-	@ApiOperation(value="修改数据", notes = "")
134
+	@ApiOperation(value="修改当前数据的合同编号", notes = "")
134 135
 	@ApiImplicitParams({
135 136
 		@ApiImplicitParam(name = "notice", value = "JSON对象数据", paramType = "form")
136 137
 	})
@@ -138,6 +139,8 @@ public class ReceiveNoticeController {
138 139
 		Map<String, Object> modelMap = new HashMap<String, Object>();
139 140
 		try {
140 141
 			modelMap = receiveNoticeService.updateReceiveNotice(notice);
142
+			//给市平台推送合同被引用的消息
143
+			receiveNoticeService.pushHtStatus(notice);
141 144
 		} catch (Exception e) {
142 145
 			logger.error(e.getMessage(), e);
143 146
 			modelMap.put("status", 500);

+ 6 - 0
src/main/java/com/chinaitop/depot/business/service/ReceiveNoticeService.java

@@ -37,5 +37,11 @@ public interface ReceiveNoticeService {
37 37
 	 * @return
38 38
 	 */
39 39
 	Map<String, Object> updateReceiveNotice(String notice) throws Exception;
40
+
41
+	/**
42
+	 * 给市平台推送合同引用状态
43
+	 * @param notice
44
+	 */
45
+	void pushHtStatus(String notice) throws Exception;
40 46
 			
41 47
 }

+ 45 - 3
src/main/java/com/chinaitop/depot/business/service/impl/ReceiveNoticeServiceImpl.java

@@ -19,13 +19,18 @@ import org.springframework.stereotype.Service;
19 19
 import com.alibaba.fastjson.JSONObject;
20 20
 import com.chinaitop.depot.business.mapper.BusinessNoticeReceiveMapper;
21 21
 import com.chinaitop.depot.business.model.BusinessApproval;
22
+import com.chinaitop.depot.business.model.BusinessContractReceive;
22 23
 import com.chinaitop.depot.business.model.BusinessNoticeReceive;
23 24
 import com.chinaitop.depot.business.model.BusinessNoticeReceiveExample;
24 25
 import com.chinaitop.depot.business.model.BusinessNoticeReceiveExample.Criteria;
25 26
 import com.chinaitop.depot.business.service.BusinessApprovalService;
27
+import com.chinaitop.depot.business.service.BusinessContractReceiveService;
26 28
 import com.chinaitop.depot.business.service.FeignAgileService;
27 29
 import com.chinaitop.depot.business.service.FeignBasicService;
28 30
 import com.chinaitop.depot.business.service.ReceiveNoticeService;
31
+import com.chinaitop.depot.business.service.SystemOutsideDataService;
32
+import com.chinaitop.depot.system.service.SysCodeService;
33
+import com.chinaitop.depot.utils.HTTPUtils;
29 34
 import com.chinaitop.depot.utils.ParameterUtil;
30 35
 import com.fasterxml.jackson.databind.ObjectMapper;
31 36
 import com.github.pagehelper.PageHelper;
@@ -41,6 +46,12 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
41 46
 	private FeignAgileService feignAgileService;
42 47
 	@Resource
43 48
     private BusinessApprovalService businessApprovalService;
49
+	@Resource
50
+	private BusinessContractReceiveService businessContractReceiveService;
51
+	@Resource
52
+	private SysCodeService sysCodeService;
53
+	@Resource
54
+	private SystemOutsideDataService systemOutsideDataService;
44 55
 
45 56
 	public static final Logger logger = LoggerFactory.getLogger(ReceiveNoticeServiceImpl.class);
46 57
     /*@Resource
@@ -508,13 +519,44 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
508 519
 	public Map<String, Object> updateReceiveNotice(String notice) throws Exception {
509 520
 		Map<String, Object> map = new HashMap<>();
510 521
 		
511
-		ObjectMapper objectMapper = new ObjectMapper();
512
-		BusinessNoticeReceive businessNoticeReceive = objectMapper.readValue(notice, BusinessNoticeReceive.class);
513
-		businessNoticeReceiveMapper.updateByPrimaryKey(businessNoticeReceive);
522
+		BusinessNoticeReceive businessNoticeReceive = formatObject(notice);
523
+		businessNoticeReceiveMapper.updateByPrimaryKeySelective(businessNoticeReceive);
514 524
 		map.put("status", 200);
515 525
 		map.put("msg", "操作成功");
516 526
 		
517 527
 		return map;
518 528
 	}
519 529
 
530
+	@Override
531
+	public void pushHtStatus(String notice) throws Exception {
532
+
533
+		String result = "";
534
+
535
+		//获取请求的URL地址
536
+		String path = sysCodeService.getSVal(10, "tshtyyzt");
537
+
538
+		BusinessNoticeReceive businessNoticeReceive = formatObject(notice);
539
+		List<BusinessContractReceive> list = businessContractReceiveService.queryByExample(businessNoticeReceive.getHtbh(), businessNoticeReceive.getOrgId(), null, null, null);
540
+		if (null != list && list.size() > 0) {
541
+			String htbm = list.get(0).getSptHtid();
542
+
543
+			//组装请求参数
544
+			JSONObject object = new JSONObject();
545
+			object.put("htbm", htbm);
546
+			object.put("isChange", "0");
547
+
548
+			//给市平台发送请求
549
+			result = HTTPUtils.doPost(path, object.toString());
550
+			
551
+			//保存推送合同引用状态的消息和返回结果
552
+			systemOutsideDataService.addlogger("tshtyyzt", object.toString(), result);
553
+		}
554
+	}
555
+
556
+	private BusinessNoticeReceive formatObject(String data) throws Exception {
557
+		ObjectMapper objectMapper = new ObjectMapper();
558
+		BusinessNoticeReceive businessNoticeReceive = objectMapper.readValue(data, BusinessNoticeReceive.class);
559
+		return businessNoticeReceive;
560
+	}
561
+
520 562
 }

+ 31 - 0
src/main/java/com/chinaitop/depot/system/mapper/SysCodeMapper.java

@@ -0,0 +1,31 @@
1
+package com.chinaitop.depot.system.mapper;
2
+
3
+import com.chinaitop.depot.system.model.SysCode;
4
+import com.chinaitop.depot.system.model.SysCodeExample;
5
+import com.chinaitop.depot.system.model.SysCodeKey;
6
+import java.util.List;
7
+import org.apache.ibatis.annotations.Param;
8
+
9
+public interface SysCodeMapper {
10
+    int countByExample(SysCodeExample example);
11
+
12
+    int deleteByExample(SysCodeExample example);
13
+
14
+    int deleteByPrimaryKey(SysCodeKey key);
15
+
16
+    int insert(SysCode record);
17
+
18
+    int insertSelective(SysCode record);
19
+
20
+    List<SysCode> selectByExample(SysCodeExample example);
21
+
22
+    SysCode selectByPrimaryKey(SysCodeKey key);
23
+
24
+    int updateByExampleSelective(@Param("record") SysCode record, @Param("example") SysCodeExample example);
25
+
26
+    int updateByExample(@Param("record") SysCode record, @Param("example") SysCodeExample example);
27
+
28
+    int updateByPrimaryKeySelective(SysCode record);
29
+
30
+    int updateByPrimaryKey(SysCode record);
31
+}

+ 196 - 0
src/main/java/com/chinaitop/depot/system/mapper/SysCodeMapper.xml

@@ -0,0 +1,196 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.system.mapper.SysCodeMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.system.model.SysCode" >
5
+    <id column="org_id" property="orgId" jdbcType="INTEGER" />
6
+    <id column="s_code" property="sCode" jdbcType="VARCHAR" />
7
+    <result column="s_val" property="sVal" jdbcType="VARCHAR" />
8
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
9
+  </resultMap>
10
+  <sql id="Example_Where_Clause" >
11
+    <where >
12
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
13
+        <if test="criteria.valid" >
14
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
15
+            <foreach collection="criteria.criteria" item="criterion" >
16
+              <choose >
17
+                <when test="criterion.noValue" >
18
+                  and ${criterion.condition}
19
+                </when>
20
+                <when test="criterion.singleValue" >
21
+                  and ${criterion.condition} #{criterion.value}
22
+                </when>
23
+                <when test="criterion.betweenValue" >
24
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
25
+                </when>
26
+                <when test="criterion.listValue" >
27
+                  and ${criterion.condition}
28
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
29
+                    #{listItem}
30
+                  </foreach>
31
+                </when>
32
+              </choose>
33
+            </foreach>
34
+          </trim>
35
+        </if>
36
+      </foreach>
37
+    </where>
38
+  </sql>
39
+  <sql id="Update_By_Example_Where_Clause" >
40
+    <where >
41
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
42
+        <if test="criteria.valid" >
43
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
44
+            <foreach collection="criteria.criteria" item="criterion" >
45
+              <choose >
46
+                <when test="criterion.noValue" >
47
+                  and ${criterion.condition}
48
+                </when>
49
+                <when test="criterion.singleValue" >
50
+                  and ${criterion.condition} #{criterion.value}
51
+                </when>
52
+                <when test="criterion.betweenValue" >
53
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
54
+                </when>
55
+                <when test="criterion.listValue" >
56
+                  and ${criterion.condition}
57
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
58
+                    #{listItem}
59
+                  </foreach>
60
+                </when>
61
+              </choose>
62
+            </foreach>
63
+          </trim>
64
+        </if>
65
+      </foreach>
66
+    </where>
67
+  </sql>
68
+  <sql id="Base_Column_List" >
69
+    org_id, s_code, s_val, updatetime
70
+  </sql>
71
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.system.model.SysCodeExample" >
72
+    select
73
+    <if test="distinct" >
74
+      distinct
75
+    </if>
76
+    <include refid="Base_Column_List" />
77
+    from sys_code
78
+    <if test="_parameter != null" >
79
+      <include refid="Example_Where_Clause" />
80
+    </if>
81
+    <if test="orderByClause != null" >
82
+      order by ${orderByClause}
83
+    </if>
84
+  </select>
85
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.system.model.SysCodeKey" >
86
+    select 
87
+    <include refid="Base_Column_List" />
88
+    from sys_code
89
+    where org_id = #{orgId,jdbcType=INTEGER}
90
+      and s_code = #{sCode,jdbcType=VARCHAR}
91
+  </select>
92
+  <delete id="deleteByPrimaryKey" parameterType="com.chinaitop.depot.system.model.SysCodeKey" >
93
+    delete from sys_code
94
+    where org_id = #{orgId,jdbcType=INTEGER}
95
+      and s_code = #{sCode,jdbcType=VARCHAR}
96
+  </delete>
97
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.system.model.SysCodeExample" >
98
+    delete from sys_code
99
+    <if test="_parameter != null" >
100
+      <include refid="Example_Where_Clause" />
101
+    </if>
102
+  </delete>
103
+  <insert id="insert" parameterType="com.chinaitop.depot.system.model.SysCode" >
104
+    insert into sys_code (org_id, s_code, s_val, 
105
+      updatetime)
106
+    values (#{orgId,jdbcType=INTEGER}, #{sCode,jdbcType=VARCHAR}, #{sVal,jdbcType=VARCHAR}, 
107
+      #{updatetime,jdbcType=TIMESTAMP})
108
+  </insert>
109
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.system.model.SysCode" >
110
+    insert into sys_code
111
+    <trim prefix="(" suffix=")" suffixOverrides="," >
112
+      <if test="orgId != null" >
113
+        org_id,
114
+      </if>
115
+      <if test="sCode != null" >
116
+        s_code,
117
+      </if>
118
+      <if test="sVal != null" >
119
+        s_val,
120
+      </if>
121
+      <if test="updatetime != null" >
122
+        updatetime,
123
+      </if>
124
+    </trim>
125
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
126
+      <if test="orgId != null" >
127
+        #{orgId,jdbcType=INTEGER},
128
+      </if>
129
+      <if test="sCode != null" >
130
+        #{sCode,jdbcType=VARCHAR},
131
+      </if>
132
+      <if test="sVal != null" >
133
+        #{sVal,jdbcType=VARCHAR},
134
+      </if>
135
+      <if test="updatetime != null" >
136
+        #{updatetime,jdbcType=TIMESTAMP},
137
+      </if>
138
+    </trim>
139
+  </insert>
140
+  <select id="countByExample" parameterType="com.chinaitop.depot.system.model.SysCodeExample" resultType="java.lang.Integer" >
141
+    select count(*) from sys_code
142
+    <if test="_parameter != null" >
143
+      <include refid="Example_Where_Clause" />
144
+    </if>
145
+  </select>
146
+  <update id="updateByExampleSelective" parameterType="map" >
147
+    update sys_code
148
+    <set >
149
+      <if test="record.orgId != null" >
150
+        org_id = #{record.orgId,jdbcType=INTEGER},
151
+      </if>
152
+      <if test="record.sCode != null" >
153
+        s_code = #{record.sCode,jdbcType=VARCHAR},
154
+      </if>
155
+      <if test="record.sVal != null" >
156
+        s_val = #{record.sVal,jdbcType=VARCHAR},
157
+      </if>
158
+      <if test="record.updatetime != null" >
159
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
160
+      </if>
161
+    </set>
162
+    <if test="_parameter != null" >
163
+      <include refid="Update_By_Example_Where_Clause" />
164
+    </if>
165
+  </update>
166
+  <update id="updateByExample" parameterType="map" >
167
+    update sys_code
168
+    set org_id = #{record.orgId,jdbcType=INTEGER},
169
+      s_code = #{record.sCode,jdbcType=VARCHAR},
170
+      s_val = #{record.sVal,jdbcType=VARCHAR},
171
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
172
+    <if test="_parameter != null" >
173
+      <include refid="Update_By_Example_Where_Clause" />
174
+    </if>
175
+  </update>
176
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.system.model.SysCode" >
177
+    update sys_code
178
+    <set >
179
+      <if test="sVal != null" >
180
+        s_val = #{sVal,jdbcType=VARCHAR},
181
+      </if>
182
+      <if test="updatetime != null" >
183
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
184
+      </if>
185
+    </set>
186
+    where org_id = #{orgId,jdbcType=INTEGER}
187
+      and s_code = #{sCode,jdbcType=VARCHAR}
188
+  </update>
189
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.system.model.SysCode" >
190
+    update sys_code
191
+    set s_val = #{sVal,jdbcType=VARCHAR},
192
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
193
+    where org_id = #{orgId,jdbcType=INTEGER}
194
+      and s_code = #{sCode,jdbcType=VARCHAR}
195
+  </update>
196
+</mapper>

+ 41 - 0
src/main/java/com/chinaitop/depot/system/model/SysCode.java

@@ -0,0 +1,41 @@
1
+package com.chinaitop.depot.system.model;
2
+
3
+import java.util.Date;
4
+
5
+public class SysCode extends SysCodeKey {
6
+    private String sVal;
7
+
8
+    private Date updatetime;
9
+
10
+    /**
11
+     * null
12
+     * @return s_val null
13
+     */
14
+    public String getsVal() {
15
+        return sVal;
16
+    }
17
+
18
+    /**
19
+     * null
20
+     * @param sVal null
21
+     */
22
+    public void setsVal(String sVal) {
23
+        this.sVal = sVal == null ? null : sVal.trim();
24
+    }
25
+
26
+    /**
27
+     * null
28
+     * @return updatetime null
29
+     */
30
+    public Date getUpdatetime() {
31
+        return updatetime;
32
+    }
33
+
34
+    /**
35
+     * null
36
+     * @param updatetime null
37
+     */
38
+    public void setUpdatetime(Date updatetime) {
39
+        this.updatetime = updatetime;
40
+    }
41
+}

+ 479 - 0
src/main/java/com/chinaitop/depot/system/model/SysCodeExample.java

@@ -0,0 +1,479 @@
1
+package com.chinaitop.depot.system.model;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.List;
6
+
7
+public class SysCodeExample {
8
+    /**
9
+     * sys_code
10
+     */
11
+    protected String orderByClause;
12
+
13
+    /**
14
+     * sys_code
15
+     */
16
+    protected boolean distinct;
17
+
18
+    /**
19
+     * sys_code
20
+     */
21
+    protected List<Criteria> oredCriteria;
22
+
23
+    public SysCodeExample() {
24
+        oredCriteria = new ArrayList<Criteria>();
25
+    }
26
+
27
+    public void setOrderByClause(String orderByClause) {
28
+        this.orderByClause = orderByClause;
29
+    }
30
+
31
+    public String getOrderByClause() {
32
+        return orderByClause;
33
+    }
34
+
35
+    public void setDistinct(boolean distinct) {
36
+        this.distinct = distinct;
37
+    }
38
+
39
+    public boolean isDistinct() {
40
+        return distinct;
41
+    }
42
+
43
+    public List<Criteria> getOredCriteria() {
44
+        return oredCriteria;
45
+    }
46
+
47
+    public void or(Criteria criteria) {
48
+        oredCriteria.add(criteria);
49
+    }
50
+
51
+    public Criteria or() {
52
+        Criteria criteria = createCriteriaInternal();
53
+        oredCriteria.add(criteria);
54
+        return criteria;
55
+    }
56
+
57
+    public Criteria createCriteria() {
58
+        Criteria criteria = createCriteriaInternal();
59
+        if (oredCriteria.size() == 0) {
60
+            oredCriteria.add(criteria);
61
+        }
62
+        return criteria;
63
+    }
64
+
65
+    protected Criteria createCriteriaInternal() {
66
+        Criteria criteria = new Criteria();
67
+        return criteria;
68
+    }
69
+
70
+    public void clear() {
71
+        oredCriteria.clear();
72
+        orderByClause = null;
73
+        distinct = false;
74
+    }
75
+
76
+    /**
77
+     * sys_code 2023-07-31
78
+     */
79
+    protected abstract static class GeneratedCriteria {
80
+        protected List<Criterion> criteria;
81
+
82
+        protected GeneratedCriteria() {
83
+            super();
84
+            criteria = new ArrayList<Criterion>();
85
+        }
86
+
87
+        public boolean isValid() {
88
+            return criteria.size() > 0;
89
+        }
90
+
91
+        public List<Criterion> getAllCriteria() {
92
+            return criteria;
93
+        }
94
+
95
+        public List<Criterion> getCriteria() {
96
+            return criteria;
97
+        }
98
+
99
+        protected void addCriterion(String condition) {
100
+            if (condition == null) {
101
+                throw new RuntimeException("Value for condition cannot be null");
102
+            }
103
+            criteria.add(new Criterion(condition));
104
+        }
105
+
106
+        protected void addCriterion(String condition, Object value, String property) {
107
+            if (value == null) {
108
+                throw new RuntimeException("Value for " + property + " cannot be null");
109
+            }
110
+            criteria.add(new Criterion(condition, value));
111
+        }
112
+
113
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
114
+            if (value1 == null || value2 == null) {
115
+                throw new RuntimeException("Between values for " + property + " cannot be null");
116
+            }
117
+            criteria.add(new Criterion(condition, value1, value2));
118
+        }
119
+
120
+        public Criteria andOrgIdIsNull() {
121
+            addCriterion("org_id is null");
122
+            return (Criteria) this;
123
+        }
124
+
125
+        public Criteria andOrgIdIsNotNull() {
126
+            addCriterion("org_id is not null");
127
+            return (Criteria) this;
128
+        }
129
+
130
+        public Criteria andOrgIdEqualTo(Integer value) {
131
+            addCriterion("org_id =", value, "orgId");
132
+            return (Criteria) this;
133
+        }
134
+
135
+        public Criteria andOrgIdNotEqualTo(Integer value) {
136
+            addCriterion("org_id <>", value, "orgId");
137
+            return (Criteria) this;
138
+        }
139
+
140
+        public Criteria andOrgIdGreaterThan(Integer value) {
141
+            addCriterion("org_id >", value, "orgId");
142
+            return (Criteria) this;
143
+        }
144
+
145
+        public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
146
+            addCriterion("org_id >=", value, "orgId");
147
+            return (Criteria) this;
148
+        }
149
+
150
+        public Criteria andOrgIdLessThan(Integer value) {
151
+            addCriterion("org_id <", value, "orgId");
152
+            return (Criteria) this;
153
+        }
154
+
155
+        public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
156
+            addCriterion("org_id <=", value, "orgId");
157
+            return (Criteria) this;
158
+        }
159
+
160
+        public Criteria andOrgIdIn(List<Integer> values) {
161
+            addCriterion("org_id in", values, "orgId");
162
+            return (Criteria) this;
163
+        }
164
+
165
+        public Criteria andOrgIdNotIn(List<Integer> values) {
166
+            addCriterion("org_id not in", values, "orgId");
167
+            return (Criteria) this;
168
+        }
169
+
170
+        public Criteria andOrgIdBetween(Integer value1, Integer value2) {
171
+            addCriterion("org_id between", value1, value2, "orgId");
172
+            return (Criteria) this;
173
+        }
174
+
175
+        public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
176
+            addCriterion("org_id not between", value1, value2, "orgId");
177
+            return (Criteria) this;
178
+        }
179
+
180
+        public Criteria andSCodeIsNull() {
181
+            addCriterion("s_code is null");
182
+            return (Criteria) this;
183
+        }
184
+
185
+        public Criteria andSCodeIsNotNull() {
186
+            addCriterion("s_code is not null");
187
+            return (Criteria) this;
188
+        }
189
+
190
+        public Criteria andSCodeEqualTo(String value) {
191
+            addCriterion("s_code =", value, "sCode");
192
+            return (Criteria) this;
193
+        }
194
+
195
+        public Criteria andSCodeNotEqualTo(String value) {
196
+            addCriterion("s_code <>", value, "sCode");
197
+            return (Criteria) this;
198
+        }
199
+
200
+        public Criteria andSCodeGreaterThan(String value) {
201
+            addCriterion("s_code >", value, "sCode");
202
+            return (Criteria) this;
203
+        }
204
+
205
+        public Criteria andSCodeGreaterThanOrEqualTo(String value) {
206
+            addCriterion("s_code >=", value, "sCode");
207
+            return (Criteria) this;
208
+        }
209
+
210
+        public Criteria andSCodeLessThan(String value) {
211
+            addCriterion("s_code <", value, "sCode");
212
+            return (Criteria) this;
213
+        }
214
+
215
+        public Criteria andSCodeLessThanOrEqualTo(String value) {
216
+            addCriterion("s_code <=", value, "sCode");
217
+            return (Criteria) this;
218
+        }
219
+
220
+        public Criteria andSCodeLike(String value) {
221
+            addCriterion("s_code like", value, "sCode");
222
+            return (Criteria) this;
223
+        }
224
+
225
+        public Criteria andSCodeNotLike(String value) {
226
+            addCriterion("s_code not like", value, "sCode");
227
+            return (Criteria) this;
228
+        }
229
+
230
+        public Criteria andSCodeIn(List<String> values) {
231
+            addCriterion("s_code in", values, "sCode");
232
+            return (Criteria) this;
233
+        }
234
+
235
+        public Criteria andSCodeNotIn(List<String> values) {
236
+            addCriterion("s_code not in", values, "sCode");
237
+            return (Criteria) this;
238
+        }
239
+
240
+        public Criteria andSCodeBetween(String value1, String value2) {
241
+            addCriterion("s_code between", value1, value2, "sCode");
242
+            return (Criteria) this;
243
+        }
244
+
245
+        public Criteria andSCodeNotBetween(String value1, String value2) {
246
+            addCriterion("s_code not between", value1, value2, "sCode");
247
+            return (Criteria) this;
248
+        }
249
+
250
+        public Criteria andSValIsNull() {
251
+            addCriterion("s_val is null");
252
+            return (Criteria) this;
253
+        }
254
+
255
+        public Criteria andSValIsNotNull() {
256
+            addCriterion("s_val is not null");
257
+            return (Criteria) this;
258
+        }
259
+
260
+        public Criteria andSValEqualTo(String value) {
261
+            addCriterion("s_val =", value, "sVal");
262
+            return (Criteria) this;
263
+        }
264
+
265
+        public Criteria andSValNotEqualTo(String value) {
266
+            addCriterion("s_val <>", value, "sVal");
267
+            return (Criteria) this;
268
+        }
269
+
270
+        public Criteria andSValGreaterThan(String value) {
271
+            addCriterion("s_val >", value, "sVal");
272
+            return (Criteria) this;
273
+        }
274
+
275
+        public Criteria andSValGreaterThanOrEqualTo(String value) {
276
+            addCriterion("s_val >=", value, "sVal");
277
+            return (Criteria) this;
278
+        }
279
+
280
+        public Criteria andSValLessThan(String value) {
281
+            addCriterion("s_val <", value, "sVal");
282
+            return (Criteria) this;
283
+        }
284
+
285
+        public Criteria andSValLessThanOrEqualTo(String value) {
286
+            addCriterion("s_val <=", value, "sVal");
287
+            return (Criteria) this;
288
+        }
289
+
290
+        public Criteria andSValLike(String value) {
291
+            addCriterion("s_val like", value, "sVal");
292
+            return (Criteria) this;
293
+        }
294
+
295
+        public Criteria andSValNotLike(String value) {
296
+            addCriterion("s_val not like", value, "sVal");
297
+            return (Criteria) this;
298
+        }
299
+
300
+        public Criteria andSValIn(List<String> values) {
301
+            addCriterion("s_val in", values, "sVal");
302
+            return (Criteria) this;
303
+        }
304
+
305
+        public Criteria andSValNotIn(List<String> values) {
306
+            addCriterion("s_val not in", values, "sVal");
307
+            return (Criteria) this;
308
+        }
309
+
310
+        public Criteria andSValBetween(String value1, String value2) {
311
+            addCriterion("s_val between", value1, value2, "sVal");
312
+            return (Criteria) this;
313
+        }
314
+
315
+        public Criteria andSValNotBetween(String value1, String value2) {
316
+            addCriterion("s_val not between", value1, value2, "sVal");
317
+            return (Criteria) this;
318
+        }
319
+
320
+        public Criteria andUpdatetimeIsNull() {
321
+            addCriterion("updatetime is null");
322
+            return (Criteria) this;
323
+        }
324
+
325
+        public Criteria andUpdatetimeIsNotNull() {
326
+            addCriterion("updatetime is not null");
327
+            return (Criteria) this;
328
+        }
329
+
330
+        public Criteria andUpdatetimeEqualTo(Date value) {
331
+            addCriterion("updatetime =", value, "updatetime");
332
+            return (Criteria) this;
333
+        }
334
+
335
+        public Criteria andUpdatetimeNotEqualTo(Date value) {
336
+            addCriterion("updatetime <>", value, "updatetime");
337
+            return (Criteria) this;
338
+        }
339
+
340
+        public Criteria andUpdatetimeGreaterThan(Date value) {
341
+            addCriterion("updatetime >", value, "updatetime");
342
+            return (Criteria) this;
343
+        }
344
+
345
+        public Criteria andUpdatetimeGreaterThanOrEqualTo(Date value) {
346
+            addCriterion("updatetime >=", value, "updatetime");
347
+            return (Criteria) this;
348
+        }
349
+
350
+        public Criteria andUpdatetimeLessThan(Date value) {
351
+            addCriterion("updatetime <", value, "updatetime");
352
+            return (Criteria) this;
353
+        }
354
+
355
+        public Criteria andUpdatetimeLessThanOrEqualTo(Date value) {
356
+            addCriterion("updatetime <=", value, "updatetime");
357
+            return (Criteria) this;
358
+        }
359
+
360
+        public Criteria andUpdatetimeIn(List<Date> values) {
361
+            addCriterion("updatetime in", values, "updatetime");
362
+            return (Criteria) this;
363
+        }
364
+
365
+        public Criteria andUpdatetimeNotIn(List<Date> values) {
366
+            addCriterion("updatetime not in", values, "updatetime");
367
+            return (Criteria) this;
368
+        }
369
+
370
+        public Criteria andUpdatetimeBetween(Date value1, Date value2) {
371
+            addCriterion("updatetime between", value1, value2, "updatetime");
372
+            return (Criteria) this;
373
+        }
374
+
375
+        public Criteria andUpdatetimeNotBetween(Date value1, Date value2) {
376
+            addCriterion("updatetime not between", value1, value2, "updatetime");
377
+            return (Criteria) this;
378
+        }
379
+    }
380
+
381
+    /**
382
+     * sys_code
383
+     */
384
+    public static class Criteria extends GeneratedCriteria {
385
+
386
+        protected Criteria() {
387
+            super();
388
+        }
389
+    }
390
+
391
+    /**
392
+     * sys_code 2023-07-31
393
+     */
394
+    public static class Criterion {
395
+        private String condition;
396
+
397
+        private Object value;
398
+
399
+        private Object secondValue;
400
+
401
+        private boolean noValue;
402
+
403
+        private boolean singleValue;
404
+
405
+        private boolean betweenValue;
406
+
407
+        private boolean listValue;
408
+
409
+        private String typeHandler;
410
+
411
+        public String getCondition() {
412
+            return condition;
413
+        }
414
+
415
+        public Object getValue() {
416
+            return value;
417
+        }
418
+
419
+        public Object getSecondValue() {
420
+            return secondValue;
421
+        }
422
+
423
+        public boolean isNoValue() {
424
+            return noValue;
425
+        }
426
+
427
+        public boolean isSingleValue() {
428
+            return singleValue;
429
+        }
430
+
431
+        public boolean isBetweenValue() {
432
+            return betweenValue;
433
+        }
434
+
435
+        public boolean isListValue() {
436
+            return listValue;
437
+        }
438
+
439
+        public String getTypeHandler() {
440
+            return typeHandler;
441
+        }
442
+
443
+        protected Criterion(String condition) {
444
+            super();
445
+            this.condition = condition;
446
+            this.typeHandler = null;
447
+            this.noValue = true;
448
+        }
449
+
450
+        protected Criterion(String condition, Object value, String typeHandler) {
451
+            super();
452
+            this.condition = condition;
453
+            this.value = value;
454
+            this.typeHandler = typeHandler;
455
+            if (value instanceof List<?>) {
456
+                this.listValue = true;
457
+            } else {
458
+                this.singleValue = true;
459
+            }
460
+        }
461
+
462
+        protected Criterion(String condition, Object value) {
463
+            this(condition, value, null);
464
+        }
465
+
466
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
467
+            super();
468
+            this.condition = condition;
469
+            this.value = value;
470
+            this.secondValue = secondValue;
471
+            this.typeHandler = typeHandler;
472
+            this.betweenValue = true;
473
+        }
474
+
475
+        protected Criterion(String condition, Object value, Object secondValue) {
476
+            this(condition, value, secondValue, null);
477
+        }
478
+    }
479
+}

+ 39 - 0
src/main/java/com/chinaitop/depot/system/model/SysCodeKey.java

@@ -0,0 +1,39 @@
1
+package com.chinaitop.depot.system.model;
2
+
3
+public class SysCodeKey {
4
+    private Integer orgId;
5
+
6
+    private String sCode;
7
+
8
+    /**
9
+     * null
10
+     * @return org_id null
11
+     */
12
+    public Integer getOrgId() {
13
+        return orgId;
14
+    }
15
+
16
+    /**
17
+     * null
18
+     * @param orgId null
19
+     */
20
+    public void setOrgId(Integer orgId) {
21
+        this.orgId = orgId;
22
+    }
23
+
24
+    /**
25
+     * null
26
+     * @return s_code null
27
+     */
28
+    public String getsCode() {
29
+        return sCode;
30
+    }
31
+
32
+    /**
33
+     * null
34
+     * @param sCode null
35
+     */
36
+    public void setsCode(String sCode) {
37
+        this.sCode = sCode == null ? null : sCode.trim();
38
+    }
39
+}

+ 24 - 0
src/main/java/com/chinaitop/depot/system/service/SysCodeService.java

@@ -0,0 +1,24 @@
1
+package com.chinaitop.depot.system.service;
2
+
3
+import com.chinaitop.depot.system.model.SysCode;
4
+
5
+public interface SysCodeService {
6
+
7
+	/**
8
+	 * 按主键查询一条系统配置数据
9
+	 * @param orgId
10
+	 * @param sCode
11
+	 * @return
12
+	 * @throws Exception
13
+	 */
14
+	public SysCode querySysCode(Integer orgId, String sCode) throws Exception;
15
+	
16
+	/**
17
+	 * 按主键查询一条系统配置数据并返回配置value
18
+	 * @param orgId
19
+	 * @param sCode
20
+	 * @return
21
+	 * @throws Exception
22
+	 */
23
+	public String getSVal(Integer orgId, String sCode) throws Exception;
24
+}

+ 51 - 0
src/main/java/com/chinaitop/depot/system/service/impl/SysCodeServiceImpl.java

@@ -0,0 +1,51 @@
1
+package com.chinaitop.depot.system.service.impl;
2
+
3
+import javax.annotation.Resource;
4
+
5
+import org.apache.commons.lang3.StringUtils;
6
+import org.springframework.stereotype.Service;
7
+
8
+import com.chinaitop.depot.system.mapper.SysCodeMapper;
9
+import com.chinaitop.depot.system.model.SysCode;
10
+import com.chinaitop.depot.system.model.SysCodeKey;
11
+import com.chinaitop.depot.system.service.SysCodeService;
12
+
13
+@Service
14
+public class SysCodeServiceImpl implements SysCodeService {
15
+
16
+	@Resource
17
+	private SysCodeMapper sysCodeMapper;
18
+
19
+	@Override
20
+	public SysCode querySysCode(Integer orgId, String sCode) throws Exception {
21
+		SysCodeKey sysCodeKey = new SysCodeKey();
22
+		sysCodeKey.setOrgId(orgId);
23
+		sysCodeKey.setsCode(sCode);
24
+		SysCode en = sysCodeMapper.selectByPrimaryKey(sysCodeKey);
25
+		return en;
26
+	}
27
+
28
+	@Override
29
+	public String getSVal(Integer orgId, String sCode) throws Exception {
30
+		String val = "";
31
+		StringBuffer sbf = new StringBuffer(100);
32
+		if (StringUtils.isBlank(sCode)) {
33
+			sbf.append("code不能为空!");
34
+		}
35
+		if (null == orgId) {
36
+			sbf.append("orgId不能为空!");
37
+		}
38
+		if (sbf.toString().length() > 0) {
39
+			val = sbf.toString();
40
+		} else {
41
+			SysCode sysCode = querySysCode(orgId, sCode);
42
+			if (null != sysCode) {
43
+				val = sysCode.getsVal();
44
+			} else {
45
+				val = "无此配置";
46
+			}
47
+		}
48
+		return val;
49
+	}
50
+
51
+}