瀏覽代碼

部分细节调整第一版

YL2767 3 月之前
父節點
當前提交
303dd3cfb3

+ 1
- 1
src/main/java/com/th/demo/mapping/maint/PriceMapper.java 查看文件

@@ -19,7 +19,7 @@ public interface PriceMapper {
19 19
 
20 20
     int updateByPrimaryKey(Price record);
21 21
 
22
-    Price selectByMaterialChangeTime(String id, int changeTime,String belongId);
22
+    Price selectByMaterialChangeTime(String id, String belongId);
23 23
 
24 24
     List<Price> select(String customerName,  String belongId);
25 25
 

+ 9
- 0
src/main/java/com/th/demo/model/ware/InRecord.java 查看文件

@@ -61,6 +61,15 @@ public class InRecord {
61 61
     private String tallyPeople;
62 62
 
63 63
     private String fkComponyName;
64
+    private double invoicePrice;
65
+
66
+    public double getInvoicePrice() {
67
+        return invoicePrice;
68
+    }
69
+
70
+    public void setInvoicePrice(double invoicePrice) {
71
+        this.invoicePrice = invoicePrice;
72
+    }
64 73
 
65 74
     public String getFkComponyName() {
66 75
         return fkComponyName;

+ 9
- 0
src/main/java/com/th/demo/model/ware/OutRecord.java 查看文件

@@ -85,6 +85,15 @@ public class OutRecord {
85 85
 
86 86
     private Double storeFee;
87 87
     private Integer inWareDays;
88
+    private Double unitPrice;
89
+
90
+    public Double getUnitPrice() {
91
+        return unitPrice;
92
+    }
93
+
94
+    public void setUnitPrice(Double unitPrice) {
95
+        this.unitPrice = unitPrice;
96
+    }
88 97
 
89 98
     public Double getStoreFee() {
90 99
         return storeFee;

+ 9
- 0
src/main/java/com/th/demo/model/ware/Store.java 查看文件

@@ -74,6 +74,15 @@ public class Store  implements Comparable<Store>{
74 74
     private String fkComponyId ;
75 75
 
76 76
     private Double invoicePrice;
77
+    private String contractNo;
78
+
79
+    public String getContractNo() {
80
+        return contractNo;
81
+    }
82
+
83
+    public void setContractNo(String contractNo) {
84
+        this.contractNo = contractNo;
85
+    }
77 86
 
78 87
     public Double getInvoicePrice() {
79 88
         return invoicePrice;

+ 29
- 29
src/main/java/com/th/demo/service/impl/ware/InServiceImpl.java 查看文件

@@ -45,6 +45,8 @@ public class InServiceImpl implements InService {
45 45
     public MaterialMapper materialMapper;
46 46
     @Autowired
47 47
     public ProdPriceMapper prodPriceMapper;
48
+    @Autowired
49
+    public PriceMapper priceMapper;
48 50
     String result = Type.FAIL;
49 51
     int num = 0;
50 52
 
@@ -216,7 +218,7 @@ public class InServiceImpl implements InService {
216 218
         } else {
217 219
             currentLayer = -1;
218 220
         }
219
-        ProdPrice prodPrice = new ProdPrice();
221
+        Price Price = new Price();
220 222
         for (int m = 0; m < listSameStack.size(); m++) {
221 223
 
222 224
             if (stack.getIsLayer().equals("1")) {
@@ -228,11 +230,12 @@ public class InServiceImpl implements InService {
228 230
             listSameStack.get(m).setAddTime(new Date());
229 231
             listSameStack.get(m).setCancelFlag("0");
230 232
             listSameStack.get(m).setBelongId(belongId);
231
-            /*prodPrice = prodPriceMapper.selectByProdNm(listSameStack.get(m).getMaterial().getName());
232
-            if(prodPrice == null){
233
-                throw new Exception(listSameStack.get(m).getMaterial().getName()+"价格未维护");
233
+            Price = priceMapper.selectByMaterialChangeTime(listSameStack.get(m).getFkComponyId().toString(),belongId);
234
+            if(Price == null){
235
+                Customer fk_compony = customerMapper.selectByPrimaryKey(listSameStack.get(m).getFkComponyId());
236
+                throw new Exception(fk_compony.getName()+"公司的价格未维护");
234 237
             }
235
-            listSameStack.get(m).setInvoicePrice(prodPrice.getInvoicePrice());*/
238
+            listSameStack.get(m).setInvoicePrice(Price.getOrdPrice());
236 239
             InRecord inRecord = getInRecord(listSameStack.get(m), "1", userId);
237 240
             num += inRecordMapper.insert(inRecord);
238 241
 
@@ -250,10 +253,10 @@ public class InServiceImpl implements InService {
250 253
         List<Store> listStore = new ArrayList<>();
251 254
         String wareName = listJO.get(0).get("仓库名称").toString();
252 255
         String stackName = listJO.get(0).get("垛位号").toString();
253
-        String materialName = listJO.get(0).get("物料类型").toString();
254
-        String standard = listJO.get(0).get("钢种").toString();
256
+        String materialName = listJO.get(0).get("货物品名").toString();
257
+        String standard = listJO.get(0).get("材质").toString();
255 258
         String customerName = listJO.get(0).get("客户名称").toString();
256
-        String fk_compony_name = listJO.get(0).get("货权单位").toString();
259
+        String fk_compony_name = listJO.get(0).get("客户名称").toString();
257 260
         Ware ware = wareMapper.selectByWareName(wareName, userId, belongId);
258 261
         if (ware == null) {
259 262
             err += "未找到名为\"" + wareName + "\"的库房;";
@@ -303,33 +306,33 @@ public class InServiceImpl implements InService {
303 306
                 }
304 307
                 store.setStack(stack);
305 308
             }
306
-            if (listJO.get(i).get("物料类型").toString().equals(materialName) && listJO.get(i).get("钢种").toString().equals(standard)) {
309
+            if (listJO.get(i).get("货物品名").toString().equals(materialName) && listJO.get(i).get("材质").toString().equals(standard)) {
307 310
                 store.setMaterial(material);
308 311
             } else {
309
-                materialName = listJO.get(i).get("物料类型").toString();
310
-                standard = listJO.get(i).get("钢种").toString();
312
+                materialName = listJO.get(i).get("货物品名").toString();
313
+                standard = listJO.get(i).get("材质").toString();
311 314
                 material = materialMapper.selectByNameStandard(materialName, standard, belongId);
312 315
                 if (material == null) {
313
-                    err += "未找到名为\"" + materialName + "," + standard + "\"的物料类型;";
316
+                    err += "未找到名为\"" + materialName + "," + standard + "\"的货物品名;";
314 317
                     throw new Exception(err);
315 318
                 }
316 319
                 store.setMaterial(material);
317 320
             }
318
-            if (listJO.get(i).get("客户名称").toString().equals(customerName)) {
321
+            if (listJO.get(i).get("订单客户").toString().equals(customerName)) {
319 322
                 store.setCustomer(customer);
320 323
             } else {
321
-                customerName = listJO.get(i).get("客户名称").toString();
324
+                customerName = listJO.get(i).get("订单客户").toString();
322 325
                 customer = customerMapper.selectByName(customerName, belongId);
323 326
                 if (customer == null) {
324
-                    err += "未找到名为\"" + customerName + "\"的客户名称;";
327
+                    err += "未找到名为\"" + customerName + "\"的订单客户名称;";
325 328
                     throw new Exception(err);
326 329
                 }
327 330
                 store.setCustomer(customer);
328 331
             }
329
-            if (listJO.get(i).get("货权单位").toString().equals(fk_compony_name)) {
332
+            if (listJO.get(i).get("客户名称").toString().equals(fk_compony_name)) {
330 333
                 store.setFkComponyId(fk_compony.getId());
331 334
             } else {
332
-                fk_compony_name = listJO.get(i).get("货权单位").toString();
335
+                fk_compony_name = listJO.get(i).get("客户名称").toString();
333 336
                 fk_compony = customerMapper.selectByName(fk_compony_name, belongId);
334 337
                 if (customer == null) {
335 338
                     err += "未找到名为\"" + customerName + "\"的客户名称;";
@@ -338,14 +341,14 @@ public class InServiceImpl implements InService {
338 341
                 store.setFkComponyId(fk_compony.getId());
339 342
             }
340 343
             store.setLayer(Integer.parseInt(listJO.get(i).get("层号").toString()));
341
-            store.setPlateNo(listJO.get(i).get("产品编号").toString());
342
-            store.setModel(listJO.get(i).get("产品规格").toString());
344
+            store.setPlateNo(listJO.get(i).get("顺序号").toString());
345
+            store.setModel(listJO.get(i).get("规格").toString());
343 346
             store.setCount(Double.parseDouble(listJO.get(i).get("数量").toString()));
344 347
             store.setWeight(Double.parseDouble(listJO.get(i).get("重量").toString()));
345
-            if (listJO.get(i).get("收货地址") == null || listJO.get(i).get("收货地址").toString().equals("")) {
348
+            if (listJO.get(i).get("目的地") == null || listJO.get(i).get("目的地").toString().equals("")) {
346 349
                 store.setReceiveAddress(customer.getAddress());
347 350
             } else {
348
-                store.setReceiveAddress(listJO.get(i).get("收货地址").toString());
351
+                store.setReceiveAddress(listJO.get(i).get("目的地").toString());
349 352
             }
350 353
             if(listJO.get(i).get("备注") != null){
351 354
                 store.setRemark(listJO.get(i).get("备注").toString());
@@ -356,12 +359,6 @@ public class InServiceImpl implements InService {
356 359
             store.setCancelFlag("0");
357 360
             store.setOutFlag("0");
358 361
             store.setBelongId(belongId);
359
-            if(listJO.get(i).get("计量方式") != null){
360
-                store.setWgtDcnMtcCd(listJO.get(i).get("计量方式").toString());
361
-            }
362
-            if(listJO.get(i).get("切边类型") != null){
363
-                store.setEdgeTy(listJO.get(i).get("切边类型").toString());
364
-            }
365 362
             if(listJO.get(i).get("产地") != null){
366 363
                 store.setProductionPlace(listJO.get(i).get("产地").toString());
367 364
             }
@@ -369,11 +366,14 @@ public class InServiceImpl implements InService {
369 366
             if(listJO.get(i).get("订单号") != null){
370 367
                 store.setOrdNo(listJO.get(i).get("订单号").toString());
371 368
             }
369
+            if(listJO.get(i).get("合约号") != null){
370
+                store.setContractNo(listJO.get(i).get("合约号").toString());
371
+            }
372 372
             if(listJO.get(i).get("车号") != null){
373 373
                 store.setCarNo(listJO.get(i).get("车号").toString());
374 374
             }
375
-            if(listJO.get(i).get("入库理货人员") != null){
376
-                store.setTallyPeople(listJO.get(i).get("入库理货人员").toString());
375
+            if(listJO.get(i).get("吊装工") != null){
376
+                store.setTallyPeople(listJO.get(i).get("吊装工").toString());
377 377
             }
378 378
             listStore.add(store);
379 379
         }

+ 15
- 1
src/main/java/com/th/demo/service/impl/ware/OutServiceImpl.java 查看文件

@@ -47,6 +47,8 @@ public class OutServiceImpl implements OutService {
47 47
     public ChangeRecordMapper changeRecordMapper;
48 48
     @Autowired
49 49
     public PriceMapper priceMapper;
50
+    @Autowired
51
+    public InRecordMapper inRecordMapper;
50 52
 
51 53
     String result = Type.FAIL;
52 54
     int num = 0;
@@ -298,7 +300,19 @@ public class OutServiceImpl implements OutService {
298 300
         outRecord.setWgtDcnMtcCd(store.getWgtDcnMtcCd());
299 301
         outRecord.setEdgeTy(store.getEdgeTy());
300 302
         outRecord.setProductionPlace(store.getProductionPlace());
301
-        outRecord.setInvoicePrice(store.getInvoicePrice());
303
+        InRecord inRecord = inRecordMapper.selectByPrimaryKey(store.getInId());
304
+        double asd = (outRecord.getAddTime().getDate() - inRecord.getAddTime().getTime())/ (24 * 60 * 60 * 1000);
305
+        Price price = priceMapper.selectByMaterialChangeTime(store.getFkComponyId(),store.getBelongId());
306
+        if (asd > price.getKeepDay()){
307
+            outRecord.setInvoicePrice(price.getOutOrdPrice());
308
+            outRecord.setUnitPrice(price.getOutOrdPrice());
309
+        }else {
310
+            outRecord.setInvoicePrice(price.getOrdPrice());
311
+            outRecord.setUnitPrice(price.getOrdPrice());
312
+        }
313
+
314
+
315
+
302 316
         return outRecord;
303 317
     }
304 318
 

+ 1
- 2
src/main/resource/mapper/maint/PriceMapper.xml 查看文件

@@ -210,8 +210,7 @@ transfer_price,
210 210
 
211 211
   <select id="selectByMaterialChangeTime" resultMap="BaseResultMap" >
212 212
     select *   from t_maint_price
213
-    where 1=1 --material_id = #{param1,jdbcType=VARCHAR}
214
-      --and storage_type = #{param2,jdbcType=VARCHAR}
213
+    where 1=1
215 214
       and customer_id = #{param1,jdbcType=VARCHAR}
216 215
      and belong_id = #{param2,jdbcType=VARCHAR}
217 216
      and cancel_flag = '0'

+ 8
- 5
src/main/resource/mapper/ware/OutRecordMapper.xml 查看文件

@@ -39,6 +39,7 @@
39 39
     <result column="fk_compony_name" property="fkComponyName" jdbcType="VARCHAR" />
40 40
     <result column="invoice_price" property="invoicePrice" jdbcType="DOUBLE" />
41 41
     <result column="verify_account_id" property="verifyAccountId" jdbcType="DOUBLE" />
42
+    <result column="unit_price" property="unitPrice" jdbcType="DOUBLE" />
42 43
 
43 44
     <result column="in_ware_days" property="inWareDays" jdbcType="INTEGER" />
44 45
     <result column="store_fee" property="storeFee" jdbcType="DOUBLE" />
@@ -88,6 +89,7 @@
88 89
     <result column="distribution_id" property="distributionId" jdbcType="VARCHAR" />
89 90
     <result column="in_ware_days" property="inWareDays" jdbcType="INTEGER" />
90 91
     <result column="store_fee" property="storeFee" jdbcType="DOUBLE" />
92
+    <result column="unit_price" property="unitPrice" jdbcType="DOUBLE" />
91 93
   </resultMap>
92 94
   <resultMap id="TotalResultMap" type="com.th.demo.model.ware.TotalRecord">
93 95
     <result column="total_amount" property="totalAmount" jdbcType="DOUBLE" />
@@ -96,7 +98,7 @@
96 98
   <sql id="Base_Column_List" >
97 99
     id, ware_name, stack_name, layer, material_name, material_no, standard, model, customer_name, 
98 100
     customer_no, count, weight, remark, add_id, add_time, modify_id, modify_time, cancel_id, 
99
-    cancel_time, cancel_flag, belong_id, plate_no,in_id, record_type,back_flag,receive_address,distribution_id,wgt_dcn_mtc_cd,edge_ty,production_place,verify_account_id
101
+    cancel_time, cancel_flag, belong_id, plate_no,in_id, record_type,back_flag,receive_address,distribution_id,wgt_dcn_mtc_cd,edge_ty,production_place,verify_account_id,unit_price
100 102
   </sql>
101 103
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
102 104
     select 
@@ -120,7 +122,7 @@
120 122
       modify_id, modify_time, cancel_id, 
121 123
       cancel_time, cancel_flag, belong_id, 
122 124
       plate_no,in_id, record_type,back_flag,receive_address,distribution_id
123
-    ,wgt_dcn_mtc_cd,edge_ty,production_place,tally_people,invoice_price)
125
+    ,wgt_dcn_mtc_cd,edge_ty,production_place,tally_people,invoice_price,unit_price)
124 126
     values (#{id,jdbcType=VARCHAR}, #{wareName,jdbcType=VARCHAR}, #{stackName,jdbcType=VARCHAR}, 
125 127
       #{layer,jdbcType=INTEGER}, #{materialName,jdbcType=VARCHAR}, #{materialNo,jdbcType=VARCHAR}, 
126 128
       #{standard,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, 
@@ -130,7 +132,7 @@
130 132
       #{cancelTime,jdbcType=TIMESTAMP}, #{cancelFlag,jdbcType=VARCHAR}, #{belongId,jdbcType=VARCHAR},
131 133
     #{plateNo,jdbcType=VARCHAR},  #{inId,jdbcType=VARCHAR}, #{recordType,jdbcType=VARCHAR},
132 134
     #{backFlag,jdbcType=VARCHAR}, #{receiveAddress,jdbcType=VARCHAR}, #{distributionId,jdbcType=VARCHAR}
133
-    ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE})
135
+    ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE},#{unitPrice,jdbcType=DOUBLE})
134 136
   </insert>
135 137
   <insert id="insertSelective" parameterType="com.th.demo.model.ware.OutRecord" >
136 138
     insert into t_ware_out_record
@@ -367,7 +369,8 @@
367 369
            record_type = #{recordType,jdbcType=VARCHAR},
368 370
           back_flag =  #{backFlag,jdbcType=VARCHAR},
369 371
     receive_address = #{receiveAddress,jdbcType=VARCHAR},
370
-      distribution_id =  #{distributionId,jdbcType=VARCHAR}
372
+      distribution_id =  #{distributionId,jdbcType=VARCHAR},
373
+        unit_price =  #{unitPrice,jdbcType=DOUBLE}
371 374
     where id = #{id,jdbcType=VARCHAR}
372 375
   </update>
373 376
 
@@ -379,7 +382,7 @@
379 382
 
380 383
   <update id="savePriceMod" parameterType="com.th.demo.model.ware.OutRecord" >
381 384
     update t_ware_out_record t
382
-    set t.invoice_price = #{invoicePrice,jdbcType=DOUBLE}
385
+    set t.unit_price = #{invoicePrice,jdbcType=DOUBLE}
383 386
     where id = #{id,jdbcType=VARCHAR}
384 387
   </update>
385 388
   <update id="cleanVerifyInfo" parameterType="java.lang.String" >

+ 6
- 4
src/main/resource/mapper/ware/StoreMapper.xml 查看文件

@@ -32,6 +32,7 @@
32 32
     <result column="fk_compony_id" property="fkComponyId" jdbcType="VARCHAR" />
33 33
 
34 34
     <result column="invoice_price" property="invoicePrice" jdbcType="DOUBLE" />
35
+    <result column="contract_no" property="contractNo" jdbcType="VARCHAR" />
35 36
 
36 37
 
37 38
     <association  column="ware_id" property="ware" select="com.th.demo.mapping.maint.WareMapper.selectByPrimaryKey" />
@@ -56,7 +57,7 @@
56 57
   <sql id="Base_Column_List" >
57 58
     id, ware_id, stack_id, layer, material_id, model, plate_no, customer_id, count, weight,
58 59
     remark, add_id, add_time, modify_id, modify_time, cancel_id, cancel_time, cancel_flag,
59
-    belong_id, in_id, out_id, receive_address, out_flag, lock_flag,wgt_dcn_mtc_cd,edge_ty,production_place
60
+    belong_id, in_id, out_id, receive_address, out_flag, lock_flag,wgt_dcn_mtc_cd,edge_ty,production_place,contract_no
60 61
   </sql>
61 62
 
62 63
 
@@ -86,7 +87,7 @@
86 87
       belong_id, in_id, out_id,
87 88
       receive_address, out_flag, lock_flag
88 89
       ,wgt_dcn_mtc_cd,edge_ty,production_place,ord_no
89
-      ,car_no,tally_people,fk_compony_id,invoice_price
90
+      ,car_no,tally_people,fk_compony_id,invoice_price,contract_no
90 91
     )
91 92
     values (#{id,jdbcType=VARCHAR}, #{ware.id,jdbcType=VARCHAR}, #{stack.id,jdbcType=VARCHAR},
92 93
       #{layer,jdbcType=INTEGER}, #{material.id,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR},
@@ -97,7 +98,7 @@
97 98
       #{belongId,jdbcType=VARCHAR}, #{inId,jdbcType=VARCHAR}, #{outId,jdbcType=VARCHAR},
98 99
       #{receiveAddress,jdbcType=VARCHAR}, #{outFlag,jdbcType=VARCHAR}, #{lockFlag,jdbcType=VARCHAR}
99 100
       ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{ordNo,jdbcType=VARCHAR}
100
-     ,#{carNo,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{fkComponyId,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE}
101
+     ,#{carNo,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{fkComponyId,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE},#{contractNo,jdbcType=VARCHAR}
101 102
       )
102 103
   </insert>
103 104
 
@@ -324,7 +325,8 @@
324 325
       out_id = #{outId,jdbcType=VARCHAR},
325 326
       receive_address = #{receiveAddress,jdbcType=VARCHAR},
326 327
       out_flag = #{outFlag,jdbcType=VARCHAR},
327
-      lock_flag = #{lockFlag,jdbcType=VARCHAR}
328
+      lock_flag = #{lockFlag,jdbcType=VARCHAR},
329
+      contract_no = #{contractNo,jdbcType=VARCHAR}
328 330
     where id = #{id,jdbcType=VARCHAR}
329 331
   </update>
330 332
 

Loading…
取消
儲存