wangchenchen 1 місяць тому
джерело
коміт
425adc5d7a

+ 19
- 0
src/main/java/com/th/demo/controller/ware/OutRecordController.java Переглянути файл

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
 
11
 
12
     int insertSelective(Distribution record);
12
     int insertSelective(Distribution record);
13
 
13
 
14
-    Distribution selectByPrimaryKey(Integer id);
14
+    Distribution selectByPrimaryKey(String id);
15
 
15
 
16
     int updateByPrimaryKeySelective(Distribution record);
16
     int updateByPrimaryKeySelective(Distribution record);
17
 
17
 

+ 17
- 0
src/main/java/com/th/demo/service/impl/ware/OutRecordServiceImpl.java Переглянути файл

6
 import com.github.pagehelper.PageInfo;
6
 import com.github.pagehelper.PageInfo;
7
 import com.th.demo.mapping.finance.ModPriceLogMapper;
7
 import com.th.demo.mapping.finance.ModPriceLogMapper;
8
 import com.th.demo.mapping.finance.VerifyAccountMapper;
8
 import com.th.demo.mapping.finance.VerifyAccountMapper;
9
+import com.th.demo.mapping.ware.DistributionMapper;
9
 import com.th.demo.mapping.ware.OutRecordMapper;
10
 import com.th.demo.mapping.ware.OutRecordMapper;
10
 import com.th.demo.model.finance.ModPriceLog;
11
 import com.th.demo.model.finance.ModPriceLog;
11
 import com.th.demo.model.finance.VerifyAccount;
12
 import com.th.demo.model.finance.VerifyAccount;
12
 import com.th.demo.model.system.Type;
13
 import com.th.demo.model.system.Type;
14
+import com.th.demo.model.ware.Distribution;
13
 import com.th.demo.model.ware.OutRecord;
15
 import com.th.demo.model.ware.OutRecord;
14
 import com.th.demo.model.ware.Store;
16
 import com.th.demo.model.ware.Store;
15
 import com.th.demo.model.ware.TotalRecord;
17
 import com.th.demo.model.ware.TotalRecord;
30
     public OutRecordMapper outRecordMapper;
32
     public OutRecordMapper outRecordMapper;
31
     @Autowired
33
     @Autowired
32
     public VerifyAccountMapper verifyAccountMapper;
34
     public VerifyAccountMapper verifyAccountMapper;
35
+    @Autowired
36
+    public DistributionMapper distributionMapper;
33
 
37
 
34
     @Autowired
38
     @Autowired
35
     public ModPriceLogMapper modPriceLogMapper;
39
     public ModPriceLogMapper modPriceLogMapper;
140
         }
144
         }
141
         return Tools.moreThanZeroResultJSON(num);
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
     String saveVerifyAcc(String json, String accWgt, String accAmt, String invoiceAmt, String accDate, String accReminder, String userId, String belongId);
12
     String saveVerifyAcc(String json, String accWgt, String accAmt, String invoiceAmt, String accDate, String accReminder, String userId, String belongId);
13
 
13
 
14
     String savePriceMod(String json, String modPrice, String userId, String belongId);
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
-#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
 jdbc.driverClass=com.mysql.jdbc.Driver
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
 jdbc.user=root
3
 jdbc.user=root
9
 jdbc.password=root
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
 #jdbc.driverClass=com.mysql.jdbc.Driver
11
 #jdbc.driverClass=com.mysql.jdbc.Driver
12
 #jdbc.jdbcUrl=jdbc:mysql://60.205.9.174:3309/ware_zg?useUnicode=true&characterEncoding=utf8
12
 #jdbc.jdbcUrl=jdbc:mysql://60.205.9.174:3309/ware_zg?useUnicode=true&characterEncoding=utf8
13
 #jdbc.user=root
13
 #jdbc.user=root

+ 1
- 0
src/main/resource/mapper/ware/OutRecordMapper.xml Переглянути файл

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

Завантаження…
Відмінити
Зберегти