YL2767 2 weeks ago
parent
commit
cce1a3057b

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

@@ -23,7 +23,7 @@ public interface PriceMapper {
23 23
 
24 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 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,6 +29,10 @@ public class Material {
29 29
 
30 30
     private String belongId;
31 31
 
32
+    private String attri1;
33
+    private String attri2;
34
+    private String attri3;
35
+
32 36
     public String getId() {
33 37
         return id;
34 38
     }
@@ -132,4 +136,28 @@ public class Material {
132 136
     public void setBelongId(String belongId) {
133 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,10 +44,10 @@ public class PriceServiceImpl implements PriceService {
44 44
     public String save(String json, String userId, String belongId) {
45 45
         Price price = JSON.parseObject(json,new TypeReference<Price>(){});
46 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 51
             price.setAddUser(new SysUser(userId));
52 52
             price.setAddTime(new Date());
53 53
             price.setModifyUser(new SysUser(userId));
@@ -56,12 +56,12 @@ public class PriceServiceImpl implements PriceService {
56 56
             price.setBelongId(belongId);
57 57
             num += priceMapper.insert(price);
58 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 65
             price.setModifyUser(new SysUser(userId));
66 66
             price.setModifyTime(new Date());
67 67
             num += priceMapper.updateByPrimaryKey(price);

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

@@ -398,16 +398,16 @@ public class InServiceImpl implements InService {
398 398
 //                throw new Exception(listSameStack.get(m).getMaterial().getName()+"价格未维护");
399 399
 //            }
400 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 411
             InRecord inRecord = getInRecord(listSameStack.get(m), "1", userId);
412 412
             num += inRecordMapper.insert(inRecord);
413 413
 

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

@@ -319,7 +319,7 @@ public class OutServiceImpl implements OutService {
319 319
             int days = toIntExact(days_L);
320 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 323
             if (priceList.size() ==1){
324 324
                 Price price = priceList.get(0);
325 325
                 if (price.getKeepDay() >= days){

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

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

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

@@ -244,7 +244,9 @@ transfer_price,
244 244
     where 1=1
245 245
       and t.customer_id = #{param1,jdbcType=VARCHAR}
246 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 250
       and t.cancel_flag = '0'
249 251
   </select>
250 252
 </mapper>

Loading…
Cancel
Save