记得上下班打卡 | git大法好,push需谨慎

Commit 179e7cae authored by sunyuntian's avatar sunyuntian

运费0元改为标快

parent 8c60f684
...@@ -9,4 +9,5 @@ import java.util.HashMap; ...@@ -9,4 +9,5 @@ import java.util.HashMap;
public interface KylinFreightChargeMapper extends BaseMapper<KylinFreightChargeDao>{ public interface KylinFreightChargeMapper extends BaseMapper<KylinFreightChargeDao>{
int setFreightCharge(KylinFreightChargeDao kylinFreightCharge); int setFreightCharge(KylinFreightChargeDao kylinFreightCharge);
void delTableData();
} }
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
<if test="businessType != null and businessType != ''">#{businessType},</if> <if test="businessType != null and businessType != ''">#{businessType},</if>
<if test="businessTypeDesc != null and businessTypeDesc != ''">#{businessTypeDesc}</if> <if test="businessTypeDesc != null and businessTypeDesc != ''">#{businessTypeDesc}</if>
) )
</insert> </insert>
<delete id="delTableData">
DELETE FROM kylin_freight_charge
</delete>
</mapper> </mapper>
...@@ -46,7 +46,8 @@ public class KylinFreightChargeServiceImpl { ...@@ -46,7 +46,8 @@ public class KylinFreightChargeServiceImpl {
hBody.put("jProvince", jProvince); //寄件地址 hBody.put("jProvince", jProvince); //寄件地址
hBody.put("jCity", jCity); hBody.put("jCity", jCity);
hBody.put("jAddress", jAddress); hBody.put("jAddress", jAddress);
//清空表
kylinFreightChargeMapper.delTableData();
String fileName = KylinFreightChargeServiceImpl.class.getClassLoader().getResource("city_2021.json").getPath(); String fileName = KylinFreightChargeServiceImpl.class.getClassLoader().getResource("city_2021.json").getPath();
String s = jsonUtils.readJsonFile(fileName); String s = jsonUtils.readJsonFile(fileName);
List<HashMap> provinceListMap = JSONObject.parseArray(s, HashMap.class); List<HashMap> provinceListMap = JSONObject.parseArray(s, HashMap.class);
...@@ -66,8 +67,13 @@ public class KylinFreightChargeServiceImpl { ...@@ -66,8 +67,13 @@ public class KylinFreightChargeServiceImpl {
String productCode = kylinExpressModuleVo.getProductCode().toString(); //快件类型码 String productCode = kylinExpressModuleVo.getProductCode().toString(); //快件类型码
String adcode = (String) adMap.get("adcode"); String adcode = (String) adMap.get("adcode");
String dAddress = (String) adMap.get("name"); String dAddress = (String) adMap.get("name");
hBody.put("expressType", productCode); // if (dProvince.equals("北京市") || dProvince.equals("天津市") || dProvince.equals("河北省")){
hBody.put("dProvince", dProvince); // hBody.put("expressType", "2");//快递类型
// }else {
// hBody.put("expressType", productCode);//快递类型
// }
hBody.put("expressType", productCode);//快递类型
hBody.put("dProvince", dProvince); //省
hBody.put("dCity", dCity); hBody.put("dCity", dCity);
hBody.put("dAddress", dAddress); hBody.put("dAddress", dAddress);
KylinFreightChargeDao kylinFreightCharge = KylinFreightChargeDao.getNew(); KylinFreightChargeDao kylinFreightCharge = KylinFreightChargeDao.getNew();
...@@ -84,6 +90,15 @@ public class KylinFreightChargeServiceImpl { ...@@ -84,6 +90,15 @@ public class KylinFreightChargeServiceImpl {
kylinFreightCharge.setAdname(dAddress); kylinFreightCharge.setAdname(dAddress);
kylinFreightCharge.setAdcode(adcode); kylinFreightCharge.setAdcode(adcode);
String price = map.get("price"); String price = map.get("price");
if (price.equals("0元")){
hBody.put("expressType", "2");//快递类型
// 生成签名并请求
String SFresult = shunfengSignUtils.generateSignatureAndRequestNew(hBody, "/public/order/v1/getFreight");
hashMap = JsonUtils.fromJson(SFresult, HashMap.class);
HashMap<String, String> SFmap = (HashMap<String, String>) hashMap.get("result");
price=SFmap.get("price");
}
String p = price.replace("元",".00"); String p = price.replace("元",".00");
kylinFreightCharge.setPrice(p); kylinFreightCharge.setPrice(p);
kylinFreightCharge.setBusinessType(map.get("businessType")); kylinFreightCharge.setBusinessType(map.get("businessType"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment