wangchenchen пре 1 месец
родитељ
комит
425adc5d7a

+ 19
- 0
src/main/java/com/th/demo/controller/ware/OutRecordController.java Прегледај датотеку

@@ -123,5 +123,24 @@ public class OutRecordController {
123 123
         }
124 124
     }
125 125
 
126
+    @RequestMapping(value = "/saveCar.do" , method = RequestMethod.POST)
127
+    public String saveCar(String json,
128
+                               String truckNo,
129
+                               String driverName,
130
+                               String driverPhone,
131
+                               HttpServletRequest request) {
132
+
133
+        try {
134
+            String userId = (String) request.getAttribute("userId");
135
+            String belongId = (String) request.getAttribute("belongId");
136
+            result = outRecordService.saveCar(json,truckNo,driverName,driverPhone,userId,belongId);
137
+        } catch (Exception ex) {
138
+            ex.printStackTrace();
139
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
140
+        } finally {
141
+            return result;
142
+        }
143
+    }
144
+
126 145
 
127 146
 }

+ 1
- 1
src/main/java/com/th/demo/mapping/ware/DistributionMapper.java Прегледај датотеку

@@ -11,7 +11,7 @@ public interface DistributionMapper {
11 11
 
12 12
     int insertSelective(Distribution record);
13 13
 
14
-    Distribution selectByPrimaryKey(Integer id);
14
+    Distribution selectByPrimaryKey(String id);
15 15
 
16 16
     int updateByPrimaryKeySelective(Distribution record);
17 17
 

+ 17
- 0
src/main/java/com/th/demo/service/impl/ware/OutRecordServiceImpl.java Прегледај датотеку

@@ -6,10 +6,12 @@ import com.github.pagehelper.PageHelper;
6 6
 import com.github.pagehelper.PageInfo;
7 7
 import com.th.demo.mapping.finance.ModPriceLogMapper;
8 8
 import com.th.demo.mapping.finance.VerifyAccountMapper;
9
+import com.th.demo.mapping.ware.DistributionMapper;
9 10
 import com.th.demo.mapping.ware.OutRecordMapper;
10 11
 import com.th.demo.model.finance.ModPriceLog;
11 12
 import com.th.demo.model.finance.VerifyAccount;
12 13
 import com.th.demo.model.system.Type;
14
+import com.th.demo.model.ware.Distribution;
13 15
 import com.th.demo.model.ware.OutRecord;
14 16
 import com.th.demo.model.ware.Store;
15 17
 import com.th.demo.model.ware.TotalRecord;
@@ -30,6 +32,8 @@ public class OutRecordServiceImpl implements OutRecordService {
30 32
     public OutRecordMapper outRecordMapper;
31 33
     @Autowired
32 34
     public VerifyAccountMapper verifyAccountMapper;
35
+    @Autowired
36
+    public DistributionMapper distributionMapper;
33 37
 
34 38
     @Autowired
35 39
     public ModPriceLogMapper modPriceLogMapper;
@@ -140,6 +144,19 @@ public class OutRecordServiceImpl implements OutRecordService {
140 144
         }
141 145
         return Tools.moreThanZeroResultJSON(num);
142 146
     }
147
+
148
+    @Override
149
+    public String saveCar(String json,String truckNo,String driverName,String driverPhone,String userId,String belongId) {
150
+        List<OutRecord> list = JSON.parseObject(json, new TypeReference<List<OutRecord>>() {
151
+        });
152
+        Distribution distribution = distributionMapper.selectByPrimaryKey(list.get(0).getDistributionId());
153
+        distribution.setTruckNo(truckNo);
154
+        distribution.setDriverName(driverName);
155
+        distribution.setDriverPhone(driverPhone);
156
+        num = distributionMapper.updateByPrimaryKey(distribution);
157
+
158
+        return Tools.moreThanZeroResultJSON(num);
159
+    }
143 160
 }
144 161
 
145 162
 

+ 3
- 0
src/main/java/com/th/demo/service/ware/OutRecordService.java Прегледај датотеку

@@ -12,4 +12,7 @@ public interface OutRecordService {
12 12
     String saveVerifyAcc(String json, String accWgt, String accAmt, String invoiceAmt, String accDate, String accReminder, String userId, String belongId);
13 13
 
14 14
     String savePriceMod(String json, String modPrice, String userId, String belongId);
15
+
16
+    String saveCar(String json,String truckNo,String driverName,String driverPhone,String userId,String belongId);
17
+
15 18
 }

+ 6
- 6
src/main/resource/localhost/db.properties Прегледај датотеку

@@ -1,13 +1,13 @@
1
-#jdbc.driverClass=com.mysql.jdbc.Driver
2
-#jdbc.jdbcUrl=jdbc:mysql://172.18.200.32:3306/ware_zg?characterEncoding=utf8
3
-#jdbc.user=root
4
-#jdbc.password=root
5
-
6 1
 jdbc.driverClass=com.mysql.jdbc.Driver
7
-jdbc.jdbcUrl=jdbc:mysql://localhost:3306/ware_zg?characterEncoding=utf8
2
+jdbc.jdbcUrl=jdbc:mysql://172.18.200.32:3306/ware_zg?characterEncoding=utf8
8 3
 jdbc.user=root
9 4
 jdbc.password=root
10 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 11
 #jdbc.driverClass=com.mysql.jdbc.Driver
12 12
 #jdbc.jdbcUrl=jdbc:mysql://60.205.9.174:3309/ware_zg?useUnicode=true&characterEncoding=utf8
13 13
 #jdbc.user=root

+ 1
- 0
src/main/resource/mapper/ware/OutRecordMapper.xml Прегледај датотеку

@@ -382,6 +382,7 @@
382 382
     set t.invoice_price = #{invoicePrice,jdbcType=DOUBLE}
383 383
     where id = #{id,jdbcType=VARCHAR}
384 384
   </update>
385
+
385 386
   <update id="cleanVerifyInfo" parameterType="java.lang.String" >
386 387
     update t_ware_out_record t
387 388
     set t.verify_account_id = null

Loading…
Откажи
Сачувај