YL2767 2 gün önce
ebeveyn
işleme
0a4fab5731

+ 10
- 0
pom.xml Dosyayı Görüntüle

550
 
550
 
551
     <build>
551
     <build>
552
         <finalName>thware_zg</finalName>
552
         <finalName>thware_zg</finalName>
553
+        <plugins>
554
+            <plugin>
555
+                <groupId>org.apache.maven.plugins</groupId>
556
+                <artifactId>maven-compiler-plugin</artifactId>
557
+                <configuration>
558
+                    <source>8</source>
559
+                    <target>8</target>
560
+                </configuration>
561
+            </plugin>
562
+        </plugins>
553
         <resources>
563
         <resources>
554
             <resource>
564
             <resource>
555
                 <directory>src/main/resource</directory>
565
                 <directory>src/main/resource</directory>

+ 12
- 0
src/main/java/com/th/demo/model/ware/OutRecord.java Dosyayı Görüntüle

89
     private String contractNo;
89
     private String contractNo;
90
     private String packNo;
90
     private String packNo;
91
 
91
 
92
+    // 出库记录增加价格计算时间的信息
93
+    private String payWay;
94
+
95
+
92
     public Double getStoreFee() {
96
     public Double getStoreFee() {
93
         return storeFee;
97
         return storeFee;
94
     }
98
     }
447
     public void setPackNo(String packNo) {
451
     public void setPackNo(String packNo) {
448
         this.packNo = packNo;
452
         this.packNo = packNo;
449
     }
453
     }
454
+
455
+    public String getPayWay() {
456
+        return payWay;
457
+    }
458
+
459
+    public void setPayWay(String payWay) {
460
+        this.payWay = payWay;
461
+    }
450
 }
462
 }

+ 37
- 2
src/main/java/com/th/demo/service/impl/ware/OutServiceImpl.java Dosyayı Görüntüle

25
 
25
 
26
 import java.util.*;
26
 import java.util.*;
27
 
27
 
28
+import static java.lang.Math.toIntExact;
29
+
28
 @Service("OutService")
30
 @Service("OutService")
29
 public class OutServiceImpl implements OutService {
31
 public class OutServiceImpl implements OutService {
30
 
32
 
48
     public ChangeRecordMapper changeRecordMapper;
50
     public ChangeRecordMapper changeRecordMapper;
49
     @Autowired
51
     @Autowired
50
     public PriceMapper priceMapper;
52
     public PriceMapper priceMapper;
53
+    @Autowired
54
+    public InRecordMapper inRecordMapper;
51
 
55
 
52
     String result = Type.FAIL;
56
     String result = Type.FAIL;
53
     int num = 0;
57
     int num = 0;
149
             List<StoreOfWareStack> listSows = storeMapper.selectWareStackByDistributionStore(map);
153
             List<StoreOfWareStack> listSows = storeMapper.selectWareStackByDistributionStore(map);
150
 
154
 
151
             for (int m = 0; m < listSows.size(); m++) {
155
             for (int m = 0; m < listSows.size(); m++) {
152
-
153
-
154
                 Stack stack = stackMapper.selectByPrimaryKey(listSows.get(m).getStackId());
156
                 Stack stack = stackMapper.selectByPrimaryKey(listSows.get(m).getStackId());
155
                 Map<String, Object> mapParam = new HashMap<String, Object>();
157
                 Map<String, Object> mapParam = new HashMap<String, Object>();
156
                 mapParam.put("storeId", listStoreId);
158
                 mapParam.put("storeId", listStoreId);
300
         outRecord.setEdgeTy(store.getEdgeTy());
302
         outRecord.setEdgeTy(store.getEdgeTy());
301
         outRecord.setProductionPlace(store.getProductionPlace());
303
         outRecord.setProductionPlace(store.getProductionPlace());
302
         outRecord.setInvoicePrice(store.getInvoicePrice());
304
         outRecord.setInvoicePrice(store.getInvoicePrice());
305
+
306
+        // 增加天数计算,以及计算价格
307
+        if (!recordType.equals("0")) {
308
+            InRecord inRecord = inRecordMapper.selectByPrimaryKey(store.getInId());
309
+            Date InDate = inRecord.getAddTime();
310
+            Date OutDate = new Date();
311
+            long diffMillis = OutDate.getTime() - InDate.getTime();
312
+            long millisPerDay = 24 * 60 * 60 * 1000;
313
+
314
+            // 计算天数并向上取整
315
+            Long days_L = diffMillis / millisPerDay;
316
+            if (diffMillis % millisPerDay > 0) {
317
+                days_L++;
318
+            }
319
+            int days = toIntExact(days_L);
320
+            outRecord.setInWareDays(days);
321
+
322
+            List<Price> priceList = priceMapper.selectListByCustomer(store.getFkComponyId(), store.getBelongId(),store.getMaterial().getCode());
323
+            if (priceList.size() ==1){
324
+                Price price = priceList.get(0);
325
+                if (price.getKeepDay() >= days){
326
+                    outRecord.setInvoicePrice(price.getOrdPrice()* store.getWeight());
327
+
328
+                }else {
329
+                    Double invoicePrice = price.getOrdPrice()* store.getWeight();
330
+                    invoicePrice = invoicePrice + ((days-price.getKeepDay())*price.getOutOrdPrice()* store.getWeight());
331
+                    outRecord.setInvoicePrice(invoicePrice);
332
+                }
333
+                outRecord.setPayWay(price.getPayWay());
334
+            }
335
+
336
+
337
+        }
303
         return outRecord;
338
         return outRecord;
304
     }
339
     }
305
 
340
 

+ 7
- 7
src/main/resource/localhost/db.properties Dosyayı Görüntüle

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

+ 5
- 3
src/main/resource/mapper/ware/OutRecordMapper.xml Dosyayı Görüntüle

37
     <result column="in_car_no" property="inCarNo" jdbcType="VARCHAR" />
37
     <result column="in_car_no" property="inCarNo" jdbcType="VARCHAR" />
38
     <result column="out_car_no" property="outCarNo" jdbcType="VARCHAR" />
38
     <result column="out_car_no" property="outCarNo" jdbcType="VARCHAR" />
39
     <result column="fk_compony_name" property="fkComponyName" jdbcType="VARCHAR" />
39
     <result column="fk_compony_name" property="fkComponyName" jdbcType="VARCHAR" />
40
+    <result column="pay_way" property="payWay" jdbcType="VARCHAR" />
40
     <result column="invoice_price" property="invoicePrice" jdbcType="DOUBLE" />
41
     <result column="invoice_price" property="invoicePrice" jdbcType="DOUBLE" />
41
     <result column="verify_account_id" property="verifyAccountId" jdbcType="DOUBLE" />
42
     <result column="verify_account_id" property="verifyAccountId" jdbcType="DOUBLE" />
42
 
43
 
93
     <result column="store_fee" property="storeFee" jdbcType="DOUBLE" />
94
     <result column="store_fee" property="storeFee" jdbcType="DOUBLE" />
94
     <result column="pack_no" property="packNo" jdbcType="VARCHAR" />
95
     <result column="pack_no" property="packNo" jdbcType="VARCHAR" />
95
     <result column="contract_no" property="contractNo" jdbcType="VARCHAR" />
96
     <result column="contract_no" property="contractNo" jdbcType="VARCHAR" />
97
+    <result column="pay_way" property="payWay" jdbcType="VARCHAR" />
96
   </resultMap>
98
   </resultMap>
97
   <resultMap id="TotalResultMap" type="com.th.demo.model.ware.TotalRecord">
99
   <resultMap id="TotalResultMap" type="com.th.demo.model.ware.TotalRecord">
98
     <result column="total_amount" property="totalAmount" jdbcType="DOUBLE" />
100
     <result column="total_amount" property="totalAmount" jdbcType="DOUBLE" />
105
   </sql>
107
   </sql>
106
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
108
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
107
     select 
109
     select 
108
-    <include refid="Base_Column_List" />
110
+    *
109
     from t_ware_out_record
111
     from t_ware_out_record
110
     where id = #{id,jdbcType=VARCHAR}
112
     where id = #{id,jdbcType=VARCHAR}
111
   </select>
113
   </select>
125
       modify_id, modify_time, cancel_id, 
127
       modify_id, modify_time, cancel_id, 
126
       cancel_time, cancel_flag, belong_id, 
128
       cancel_time, cancel_flag, belong_id, 
127
       plate_no,in_id, record_type,back_flag,receive_address,distribution_id
129
       plate_no,in_id, record_type,back_flag,receive_address,distribution_id
128
-    ,wgt_dcn_mtc_cd,edge_ty,production_place,tally_people,invoice_price,pack_no,contract_no,ord_no,fk_compony_name)
130
+    ,wgt_dcn_mtc_cd,edge_ty,production_place,tally_people,invoice_price,pack_no,contract_no,ord_no,fk_compony_name,in_ware_days,pay_way)
129
     values (#{id,jdbcType=VARCHAR}, #{wareName,jdbcType=VARCHAR}, #{stackName,jdbcType=VARCHAR}, 
131
     values (#{id,jdbcType=VARCHAR}, #{wareName,jdbcType=VARCHAR}, #{stackName,jdbcType=VARCHAR}, 
130
       #{layer,jdbcType=INTEGER}, #{materialName,jdbcType=VARCHAR}, #{materialNo,jdbcType=VARCHAR}, 
132
       #{layer,jdbcType=INTEGER}, #{materialName,jdbcType=VARCHAR}, #{materialNo,jdbcType=VARCHAR}, 
131
       #{standard,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, 
133
       #{standard,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, 
136
     #{plateNo,jdbcType=VARCHAR},  #{inId,jdbcType=VARCHAR}, #{recordType,jdbcType=VARCHAR},
138
     #{plateNo,jdbcType=VARCHAR},  #{inId,jdbcType=VARCHAR}, #{recordType,jdbcType=VARCHAR},
137
     #{backFlag,jdbcType=VARCHAR}, #{receiveAddress,jdbcType=VARCHAR}, #{distributionId,jdbcType=VARCHAR}
139
     #{backFlag,jdbcType=VARCHAR}, #{receiveAddress,jdbcType=VARCHAR}, #{distributionId,jdbcType=VARCHAR}
138
     ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE},
140
     ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE},
139
-    #{packNo,jdbcType=VARCHAR},#{contractNo,jdbcType=VARCHAR},#{ordNo,jdbcType=VARCHAR},#{fkComponyName,jdbcType=VARCHAR})
141
+    #{packNo,jdbcType=VARCHAR},#{contractNo,jdbcType=VARCHAR},#{ordNo,jdbcType=VARCHAR},#{fkComponyName,jdbcType=VARCHAR},#{inWareDays,jdbcType=DOUBLE},#{payWay,jdbcType=VARCHAR})
140
   </insert>
142
   </insert>
141
   <insert id="insertSelective" parameterType="com.th.demo.model.ware.OutRecord" >
143
   <insert id="insertSelective" parameterType="com.th.demo.model.ware.OutRecord" >
142
     insert into t_ware_out_record
144
     insert into t_ware_out_record

Loading…
İptal
Kaydet