YL2767 3 weeks ago
parent
commit
cce1a3057b

+ 1
- 1
src/main/java/com/th/demo/mapping/maint/PriceMapper.java View File

23
 
23
 
24
     List<Price> select(String customerName, String belongId,String materialName);
24
     List<Price> select(String customerName, String belongId,String materialName);
25
 
25
 
26
-    List<Price> selectListByCustomer(String customerName, String belongId,String materialName);
26
+    List<Price> selectListByCustomer(String customerName, String belongId,String attri1 ,String attri2 ,String attri3);
27
 
27
 
28
     int selectCntByMaterialChangeTime(String id, int i, String belongId);
28
     int selectCntByMaterialChangeTime(String id, int i, String belongId);
29
 
29
 

+ 28
- 0
src/main/java/com/th/demo/model/maint/Material.java View File

29
 
29
 
30
     private String belongId;
30
     private String belongId;
31
 
31
 
32
+    private String attri1;
33
+    private String attri2;
34
+    private String attri3;
35
+
32
     public String getId() {
36
     public String getId() {
33
         return id;
37
         return id;
34
     }
38
     }
132
     public void setBelongId(String belongId) {
136
     public void setBelongId(String belongId) {
133
         this.belongId = belongId == null ? null : belongId.trim();
137
         this.belongId = belongId == null ? null : belongId.trim();
134
     }
138
     }
139
+
140
+    public String getAttri1() {
141
+        return attri1;
142
+    }
143
+
144
+    public void setAttri1(String attri1) {
145
+        this.attri1 = attri1;
146
+    }
147
+
148
+    public String getAttri2() {
149
+        return attri2;
150
+    }
151
+
152
+    public void setAttri2(String attri2) {
153
+        this.attri2 = attri2;
154
+    }
155
+
156
+    public String getAttri3() {
157
+        return attri3;
158
+    }
159
+
160
+    public void setAttri3(String attri3) {
161
+        this.attri3 = attri3;
162
+    }
135
 }
163
 }

+ 10
- 10
src/main/java/com/th/demo/service/impl/maint/PriceServiceImpl.java View File

44
     public String save(String json, String userId, String belongId) {
44
     public String save(String json, String userId, String belongId) {
45
         Price price = JSON.parseObject(json,new TypeReference<Price>(){});
45
         Price price = JSON.parseObject(json,new TypeReference<Price>(){});
46
         if(price.getId()==null||price.getId().equals("")){
46
         if(price.getId()==null||price.getId().equals("")){
47
-            List<Price> priceList = priceMapper.selectListByCustomer(price.getCustomer().getId(),belongId,"");
48
-            if (priceList.size() >= 1){
49
-                return JSONTools.toString(1,"该客户的价格已维护,请勿重复维护");
50
-            }
47
+//            List<Price> priceList = priceMapper.selectListByCustomer(price.getCustomer().getId(),belongId,"");
48
+//            if (priceList.size() >= 1){
49
+//                return JSONTools.toString(1,"该客户的价格已维护,请勿重复维护");
50
+//            }
51
             price.setAddUser(new SysUser(userId));
51
             price.setAddUser(new SysUser(userId));
52
             price.setAddTime(new Date());
52
             price.setAddTime(new Date());
53
             price.setModifyUser(new SysUser(userId));
53
             price.setModifyUser(new SysUser(userId));
56
             price.setBelongId(belongId);
56
             price.setBelongId(belongId);
57
             num += priceMapper.insert(price);
57
             num += priceMapper.insert(price);
58
         }else {
58
         }else {
59
-            List<Price> priceList = priceMapper.selectListByCustomer(price.getCustomer().getName(),belongId,price.getMaterialName());
60
-            if (priceList.size() == 1 && !price.getId().equals(priceList.get(0).getId())){
61
-                return JSONTools.toString(1,"该客户的价格已维护,请勿重复维护");
62
-            } else if (priceList.size() > 1) {
63
-                return JSONTools.toString(1,"该客户的价格已维护,请勿重复维护");
64
-            }
59
+//            List<Price> priceList = priceMapper.selectListByCustomer(price.getCustomer().getName(),belongId,price.getMaterialName());
60
+//            if (priceList.size() == 1 && !price.getId().equals(priceList.get(0).getId())){
61
+//                return JSONTools.toString(1,"该客户的价格已维护,请勿重复维护");
62
+//            } else if (priceList.size() > 1) {
63
+//                return JSONTools.toString(1,"该客户的价格已维护,请勿重复维护");
64
+//            }
65
             price.setModifyUser(new SysUser(userId));
65
             price.setModifyUser(new SysUser(userId));
66
             price.setModifyTime(new Date());
66
             price.setModifyTime(new Date());
67
             num += priceMapper.updateByPrimaryKey(price);
67
             num += priceMapper.updateByPrimaryKey(price);

+ 10
- 10
src/main/java/com/th/demo/service/impl/ware/InServiceImpl.java View File

398
 //                throw new Exception(listSameStack.get(m).getMaterial().getName()+"价格未维护");
398
 //                throw new Exception(listSameStack.get(m).getMaterial().getName()+"价格未维护");
399
 //            }
399
 //            }
400
             // listSameStack.get(m).setInvoicePrice(prodPrice.getInvoicePrice());
400
             // listSameStack.get(m).setInvoicePrice(prodPrice.getInvoicePrice());
401
-            List<Price> priceList = priceMapper.selectListByCustomer(listSameStack.get(m).getFkComponyId(),belongId,listSameStack.get(m).getMaterial().getName());
402
-            if (priceList.size() >= 1){
403
-                listSameStack.get(m).setKeepDay(priceList.get(0).getKeepDay());
404
-                listSameStack.get(m).setOrdPrice(priceList.get(0).getOrdPrice());
405
-                listSameStack.get(m).setOutOrdPrice(priceList.get(0).getOutOrdPrice());
406
-            }
407
-            List<OrdTract> ordTractList = ordTractMapper.selectByOrdNo(listSameStack.get(m).getOrdNo(),belongId);
408
-            if (ordTractList.size() >= 1){
409
-                listSameStack.get(m).setPayWay(ordTractList.get(0).getPayWay());
410
-            }
401
+//            List<Price> priceList = priceMapper.selectListByCustomer(listSameStack.get(m).getFkComponyId(),belongId,listSameStack.get(m).getMaterial().getName());
402
+//            if (priceList.size() >= 1){
403
+//                listSameStack.get(m).setKeepDay(priceList.get(0).getKeepDay());
404
+//                listSameStack.get(m).setOrdPrice(priceList.get(0).getOrdPrice());
405
+//                listSameStack.get(m).setOutOrdPrice(priceList.get(0).getOutOrdPrice());
406
+//            }
407
+//            List<OrdTract> ordTractList = ordTractMapper.selectByOrdNo(listSameStack.get(m).getOrdNo(),belongId);
408
+//            if (ordTractList.size() >= 1){
409
+//                listSameStack.get(m).setPayWay(ordTractList.get(0).getPayWay());
410
+//            }
411
             InRecord inRecord = getInRecord(listSameStack.get(m), "1", userId);
411
             InRecord inRecord = getInRecord(listSameStack.get(m), "1", userId);
412
             num += inRecordMapper.insert(inRecord);
412
             num += inRecordMapper.insert(inRecord);
413
 
413
 

+ 1
- 1
src/main/java/com/th/demo/service/impl/ware/OutServiceImpl.java View File

319
             int days = toIntExact(days_L);
319
             int days = toIntExact(days_L);
320
             outRecord.setInWareDays(days);
320
             outRecord.setInWareDays(days);
321
 
321
 
322
-            List<Price> priceList = priceMapper.selectListByCustomer(store.getFkComponyId(), store.getBelongId(),store.getMaterial().getCode());
322
+            List<Price> priceList = priceMapper.selectListByCustomer(store.getFkComponyId(), store.getBelongId(),store.getMaterial().getAttri1(),store.getMaterial().getAttri2(),store.getMaterial().getAttri3());
323
             if (priceList.size() ==1){
323
             if (priceList.size() ==1){
324
                 Price price = priceList.get(0);
324
                 Price price = priceList.get(0);
325
                 if (price.getKeepDay() >= days){
325
                 if (price.getKeepDay() >= days){

+ 7
- 7
src/main/resource/localhost/db.properties View File

3
 #jdbc.user=root
3
 #jdbc.user=root
4
 #jdbc.password=root
4
 #jdbc.password=root
5
 
5
 
6
-jdbc.driverClass=com.mysql.jdbc.Driver
7
-jdbc.jdbcUrl=jdbc:mysql://localhost:3306/ware_zg?characterEncoding=utf8
8
-jdbc.user=root
9
-jdbc.password=root
10
-
11
 #jdbc.driverClass=com.mysql.jdbc.Driver
6
 #jdbc.driverClass=com.mysql.jdbc.Driver
12
-#jdbc.jdbcUrl=jdbc:mysql://60.205.9.174:3309/ware_zg?useUnicode=true&characterEncoding=utf8
7
+#jdbc.jdbcUrl=jdbc:mysql://localhost:3306/ware_zg?characterEncoding=utf8
13
 #jdbc.user=root
8
 #jdbc.user=root
14
-#jdbc.password=122403
9
+#jdbc.password=root
10
+
11
+jdbc.driverClass=com.mysql.jdbc.Driver
12
+jdbc.jdbcUrl=jdbc:mysql://60.205.9.174:3309/ware_zg?useUnicode=true&characterEncoding=utf8
13
+jdbc.user=root
14
+jdbc.password=122403

+ 10
- 7
src/main/resource/mapper/maint/MaterialMapper.xml View File

15
     <result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP" />
15
     <result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP" />
16
     <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
16
     <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
17
     <result column="belong_id" property="belongId" jdbcType="VARCHAR" />
17
     <result column="belong_id" property="belongId" jdbcType="VARCHAR" />
18
+    <result column="attri1" property="attri1" jdbcType="VARCHAR" />
19
+    <result column="attri2" property="attri2" jdbcType="VARCHAR" />
20
+    <result column="attri3" property="attri3" jdbcType="VARCHAR" />
18
   </resultMap>
21
   </resultMap>
19
   <sql id="Base_Column_List" >
22
   <sql id="Base_Column_List" >
20
     id, name, code, standard, model, add_id, add_time, modify_id, modify_time, cancel_id, 
23
     id, name, code, standard, model, add_id, add_time, modify_id, modify_time, cancel_id, 
22
   </sql>
25
   </sql>
23
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
26
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
24
     select 
27
     select 
25
-    <include refid="Base_Column_List" />
28
+    *
26
     from t_maint_material
29
     from t_maint_material
27
     where id = #{id,jdbcType=VARCHAR}
30
     where id = #{id,jdbcType=VARCHAR}
28
   </select>
31
   </select>
40
       standard, model, add_id, 
43
       standard, model, add_id, 
41
       add_time, modify_id, modify_time, 
44
       add_time, modify_id, modify_time, 
42
       cancel_id, cancel_time, cancel_flag, 
45
       cancel_id, cancel_time, cancel_flag, 
43
-      belong_id)
46
+      belong_id,attri1,attri2,attri3)
44
     values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
47
     values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
45
       #{standard,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{addId,jdbcType=VARCHAR}, 
48
       #{standard,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{addId,jdbcType=VARCHAR}, 
46
       #{addTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, 
49
       #{addTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, 
47
       #{cancelId,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{cancelFlag,jdbcType=VARCHAR}, 
50
       #{cancelId,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{cancelFlag,jdbcType=VARCHAR}, 
48
-      #{belongId,jdbcType=VARCHAR})
51
+      #{belongId,jdbcType=VARCHAR},#{attri1,jdbcType=VARCHAR},#{attri2,jdbcType=VARCHAR},#{attri3,jdbcType=VARCHAR})
49
   </insert>
52
   </insert>
50
   <insert id="insertSelective" parameterType="com.th.demo.model.maint.Material" >
53
   <insert id="insertSelective" parameterType="com.th.demo.model.maint.Material" >
51
     insert into t_maint_material
54
     insert into t_maint_material
187
       cancel_id = #{cancelId,jdbcType=VARCHAR},
190
       cancel_id = #{cancelId,jdbcType=VARCHAR},
188
       cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
191
       cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
189
       cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
192
       cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
190
-      belong_id = #{belongId,jdbcType=VARCHAR}
193
+      belong_id = #{belongId,jdbcType=VARCHAR},
194
+        attri1 = #{attri1,jdbcType=VARCHAR},
195
+        attri2 = #{attri2,jdbcType=VARCHAR},
196
+        attri3 = #{attri3,jdbcType=VARCHAR}
191
     where id = #{id,jdbcType=VARCHAR}
197
     where id = #{id,jdbcType=VARCHAR}
192
   </update>
198
   </update>
193
 
199
 
228
       and ifnull(cancel_flag,'0') = '0'
234
       and ifnull(cancel_flag,'0') = '0'
229
   </select>
235
   </select>
230
 
236
 
231
-
232
-
233
-
234
 </mapper>
237
 </mapper>

+ 3
- 1
src/main/resource/mapper/maint/PriceMapper.xml View File

244
     where 1=1
244
     where 1=1
245
       and t.customer_id = #{param1,jdbcType=VARCHAR}
245
       and t.customer_id = #{param1,jdbcType=VARCHAR}
246
       and t.belong_id = #{param2,jdbcType=VARCHAR}
246
       and t.belong_id = #{param2,jdbcType=VARCHAR}
247
-      and t.material_name = #{param3,jdbcType=VARCHAR}
247
+      and (t.material_name = #{param3,jdbcType=VARCHAR}
248
+           or t.material_name = #{param4,jdbcType=VARCHAR}
249
+           or t.material_name = #{param5,jdbcType=VARCHAR})
248
       and t.cancel_flag = '0'
250
       and t.cancel_flag = '0'
249
   </select>
251
   </select>
250
 </mapper>
252
 </mapper>

Loading…
Cancel
Save