|
@@ -26,10 +26,7 @@ import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
import com.ruoyi.common.exception.BaseException;
|
|
|
import com.ruoyi.common.exception.StorageFeeException;
|
|
|
import com.ruoyi.common.exception.WarehouseException;
|
|
|
-import com.ruoyi.common.utils.DateUtils;
|
|
|
-import com.ruoyi.common.utils.DictUtils;
|
|
|
-import com.ruoyi.common.utils.SecurityUtils;
|
|
|
-import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.common.utils.*;
|
|
|
import com.ruoyi.common.utils.ip.AddressUtils;
|
|
|
import com.ruoyi.common.utils.poi.DrawExcel;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtils;
|
|
@@ -56,6 +53,10 @@ import com.ruoyi.warehouseBusiness.component.CalculationWarehouseService;
|
|
|
import com.ruoyi.warehouseBusiness.component.WarehouseBillsfilterService;
|
|
|
import com.ruoyi.warehouseBusiness.component.impl.QueryWhgenlegServiceImpl;
|
|
|
import com.ruoyi.warehouseBusiness.domain.*;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.ccb.CargoInfo;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.ccb.CargoInOutResult;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.ccb.InCargoRsp;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.ccb.OutCargoRsp;
|
|
|
import com.ruoyi.warehouseBusiness.domain.dto.CalculateStorageFeesDTO;
|
|
|
import com.ruoyi.warehouseBusiness.domain.dto.WarehousebillsDTO;
|
|
|
import com.ruoyi.warehouseBusiness.domain.enums.FeesTypeEnum;
|
|
@@ -81,7 +82,6 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
import org.springframework.http.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -615,13 +615,13 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
map.put("fBilltype", "其他账务");
|
|
|
if (map.get("fVslid") != null) {
|
|
|
TVessel fVslid = tVesselMapper.selectTVesselById(((Integer) map.get("fVslid")).longValue());
|
|
|
- if (fVslid != null){
|
|
|
+ if (fVslid != null) {
|
|
|
map.put("shipsName", fVslid.getfName());
|
|
|
}
|
|
|
}
|
|
|
if (map.get("fVoyid") != null) {
|
|
|
TVoyage voyage = tVoyageMapper.selectTVoyageById(((Integer) map.get("fVoyid")).longValue());
|
|
|
- if (voyage != null){
|
|
|
+ if (voyage != null) {
|
|
|
map.put("voyage", voyage.getfNo());
|
|
|
}
|
|
|
}
|
|
@@ -3009,7 +3009,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AjaxResult ruoYiVersionOrderListNew(TWarehouseBills tWarehouseBills,LoginUser loginUser) {
|
|
|
+ public AjaxResult ruoYiVersionOrderListNew(TWarehouseBills tWarehouseBills, LoginUser loginUser) {
|
|
|
List<Map<String, Object>> result = tWarehouseBillsMapper.ruoYiVersionOrderList(tWarehouseBills);
|
|
|
List<ShipperDataVo> list = new ArrayList<>();
|
|
|
try {
|
|
@@ -4219,10 +4219,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
return AjaxResult.error("请求银行反馈异常,未找到客户");
|
|
|
}
|
|
|
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("userName", corp.getfCname());
|
|
|
- json.put("uscc", corp.getUscc());
|
|
|
- json.put("reqUser", corp.getfCname());
|
|
|
+ InCargoRsp rsp = new InCargoRsp();
|
|
|
+ rsp.setUserName(corp.getfCname());
|
|
|
+ rsp.setUscc(corp.getUscc());
|
|
|
|
|
|
List<Map<String, Object>> stockList = tWhgenlegMapper.selectStockList(tWarehouseBills.getfBillno(), tWarehouseBills.getfCorpid());
|
|
|
if (CollectionUtil.isEmpty(stockList)) {
|
|
@@ -4230,29 +4229,48 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
return AjaxResult.error("请求银行反馈异常,未找到库存");
|
|
|
}
|
|
|
|
|
|
- JSONArray array = new JSONArray();
|
|
|
- stockList.forEach(detail -> {
|
|
|
- detail.put("numberUnit", "件");
|
|
|
- detail.put("weightUnit", "千克");
|
|
|
- detail.put("cargoBelong", corp.getfCname());
|
|
|
- detail.put("inStorageNumber", detail.get("takeVoucher"));
|
|
|
- detail.put("remainNumber", detail.get("numberLeft"));
|
|
|
- detail.put("remainWeight", detail.get("weightLeft"));
|
|
|
- detail.put("electronicTags", warehousebillsitemsElabelMapper.getLabelByTop(tWarehouseBills.getfId()));
|
|
|
-
|
|
|
- JSONObject temp = new JSONObject();
|
|
|
- json.put("cargo", temp);
|
|
|
- json.put("result", "Y");
|
|
|
- array.add(temp);
|
|
|
+ List<CargoInfo> cargos = new ArrayList<>();
|
|
|
+ stockList.forEach(stockMap -> {
|
|
|
+ String temp = JSON.toJSONString(stockMap);
|
|
|
+
|
|
|
+ CargoInfo detail = JSON.parseObject(temp, CargoInfo.class);
|
|
|
+ detail.setNumberUnit("件");
|
|
|
+ detail.setWeightUnit("千克");
|
|
|
+ detail.setCargoBelong(corp.getfCname());
|
|
|
+ detail.setInStorageNumber(detail.getTakeVoucher());
|
|
|
+ detail.setRemainNumber(detail.getNumberLeft());
|
|
|
+ detail.setRemainWeight(detail.getWeightLeft());
|
|
|
+ detail.setElectronicTags(warehousebillsitemsElabelMapper.getLabelByTop(tWarehouseBills.getfId()));
|
|
|
+
|
|
|
+ cargos.add(detail);
|
|
|
});
|
|
|
|
|
|
- json.put("cargoInResults", array);
|
|
|
+ String requestTime = DateUtils.dateTimeNow() + (Math.random() * 9 + 1) * 100000;
|
|
|
+ // 签名内容
|
|
|
+ String str = "appId=" + CcbConstants.APP_ID + "&"
|
|
|
+ + "secretKey=" + CcbConstants.SECRET_KEY + "&"
|
|
|
+ + "platformId=" + CcbConstants.PLATFORM_ID + "&"
|
|
|
+ + "requestTime=" + requestTime + "&"
|
|
|
+ + "body=" + JsonUtil.toJson(rsp);
|
|
|
+
|
|
|
+ CargoInOutResult inOutResult = new CargoInOutResult();
|
|
|
+ inOutResult.setResult("Y");
|
|
|
+ inOutResult.setCargo(cargos);
|
|
|
+
|
|
|
+ List<CargoInOutResult> inOutResults = new ArrayList<>();
|
|
|
+ inOutResults.add(inOutResult);
|
|
|
+ rsp.setCargoInResults(inOutResults);
|
|
|
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
Request request = new Request.Builder()
|
|
|
.addHeader("content-type", "application/json")
|
|
|
+ .addHeader("X-RC-AppId", CcbConstants.APP_ID)
|
|
|
+ .addHeader("X-RC-Sign", ShaUtil.sha256(str))
|
|
|
+ .addHeader("X-RC-SignType", "SHA256")
|
|
|
+ .addHeader("X-RC-RequestTime", "application/json")
|
|
|
+ .addHeader("X-RC-RLF-Uid", CcbConstants.PLATFORM_ID)
|
|
|
.url(CcbConstants.IN_URL)
|
|
|
- .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), json.toString()))
|
|
|
+ .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
|
|
|
.build();
|
|
|
|
|
|
String s;
|
|
@@ -4263,6 +4281,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
return AjaxResult.error("请求银行反馈异常," + e.getMessage());
|
|
|
}
|
|
|
|
|
|
+ System.out.println("建行返回结果:" + s);
|
|
|
JSONObject result = JSON.parseObject(s);
|
|
|
if (!CcbConstants.SUCCESS.equals(result.getString("result"))) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
@@ -4544,40 +4563,58 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
return AjaxResult.error("请求银行反馈异常,未找到客户");
|
|
|
}
|
|
|
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("userName", corp.getfCname());
|
|
|
- json.put("uscc", corp.getUscc());
|
|
|
- json.put("reqUser", corp.getfCname());
|
|
|
+ OutCargoRsp rsp = new OutCargoRsp();
|
|
|
+ rsp.setUserName(corp.getfCname());
|
|
|
+ rsp.setUscc(corp.getUscc());
|
|
|
|
|
|
- List<Map<String, Object>> stockList = tWhgenlegMapper.selectStockList(tWhgenle.getfOriginalbillno(), tWhgenle.getfCorpid());
|
|
|
+ List<Map<String, Object>> stockList = tWhgenlegMapper.selectStockList(tWarehouseBills.getfBillno(), tWarehouseBills.getfCorpid());
|
|
|
if (CollectionUtil.isEmpty(stockList)) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return AjaxResult.error("请求银行反馈异常,未找到库存");
|
|
|
}
|
|
|
|
|
|
- JSONArray array = new JSONArray();
|
|
|
- stockList.forEach(detail -> {
|
|
|
- detail.put("numberUnit", "件");
|
|
|
- detail.put("weightUnit", "千克");
|
|
|
- detail.put("cargoBelong", corp.getfCname());
|
|
|
- detail.put("inStorageNumber", detail.get("takeVoucher"));
|
|
|
- detail.put("remainNumber", detail.get("numberLeft"));
|
|
|
- detail.put("remainWeight", detail.get("weightLeft"));
|
|
|
- detail.put("electronicTags", warehousebillsitemsElabelMapper.getLabelByPid(wbItem.getfId()));
|
|
|
-
|
|
|
- JSONObject temp = new JSONObject();
|
|
|
- json.put("cargo", temp);
|
|
|
- json.put("result", "Y");
|
|
|
- array.add(temp);
|
|
|
+ List<CargoInfo> cargos = new ArrayList<>();
|
|
|
+ stockList.forEach(stockMap -> {
|
|
|
+ String temp = JSON.toJSONString(stockMap);
|
|
|
+
|
|
|
+ CargoInfo detail = JSON.parseObject(temp, CargoInfo.class);
|
|
|
+ detail.setNumberUnit("件");
|
|
|
+ detail.setWeightUnit("千克");
|
|
|
+ detail.setCargoBelong(corp.getfCname());
|
|
|
+ detail.setInStorageNumber(detail.getTakeVoucher());
|
|
|
+ detail.setRemainNumber(detail.getNumberLeft());
|
|
|
+ detail.setRemainWeight(detail.getWeightLeft());
|
|
|
+ detail.setElectronicTags(warehousebillsitemsElabelMapper.getLabelByTop(tWarehouseBills.getfId()));
|
|
|
+
|
|
|
+ cargos.add(detail);
|
|
|
});
|
|
|
|
|
|
- json.put("cargoInResults", array);
|
|
|
+ String requestTime = DateUtils.dateTimeNow() + (Math.random() * 9 + 1) * 100000;
|
|
|
+ // 签名内容
|
|
|
+ String str = "appId=" + CcbConstants.APP_ID + "&"
|
|
|
+ + "secretKey=" + CcbConstants.SECRET_KEY + "&"
|
|
|
+ + "platformId=" + CcbConstants.PLATFORM_ID + "&"
|
|
|
+ + "requestTime=" + requestTime + "&"
|
|
|
+ + "body=" + JsonUtil.toJson(rsp);
|
|
|
+
|
|
|
+ CargoInOutResult inOutResult = new CargoInOutResult();
|
|
|
+ inOutResult.setResult("Y");
|
|
|
+ inOutResult.setCargo(cargos);
|
|
|
+
|
|
|
+ List<CargoInOutResult> inOutResults = new ArrayList<>();
|
|
|
+ inOutResults.add(inOutResult);
|
|
|
+ rsp.setCargoOutResults(inOutResults);
|
|
|
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
Request request = new Request.Builder()
|
|
|
.addHeader("content-type", "application/json")
|
|
|
+ .addHeader("X-RC-AppId", CcbConstants.APP_ID)
|
|
|
+ .addHeader("X-RC-Sign", ShaUtil.sha256(str))
|
|
|
+ .addHeader("X-RC-SignType", "SHA256")
|
|
|
+ .addHeader("X-RC-RequestTime", "application/json")
|
|
|
+ .addHeader("X-RC-RLF-Uid", CcbConstants.PLATFORM_ID)
|
|
|
.url(CcbConstants.OUT_URL)
|
|
|
- .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), json.toString()))
|
|
|
+ .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
|
|
|
.build();
|
|
|
|
|
|
String s;
|
|
@@ -9424,12 +9461,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public AjaxResult receipt(TWarehouseBills tWarehouseBills,LoginUser loginUser) {
|
|
|
+ public AjaxResult receipt(TWarehouseBills tWarehouseBills, LoginUser loginUser) {
|
|
|
List<JoabBoxVo> receipt = tWarehousebillsCntritemsMapper.receipt(tWarehouseBills.getOrderList());
|
|
|
if (CollectionUtils.isEmpty(receipt)) {
|
|
|
throw new SecurityException("未找到设备交接单信息");
|
|
|
- }else {
|
|
|
- receipt.stream().forEach(item ->{
|
|
|
+ } else {
|
|
|
+ receipt.stream().forEach(item -> {
|
|
|
item.setContPerson(loginUser.getUsername());//押箱操作人姓名
|
|
|
item.setPrintPerson(loginUser.getUsername());//打印操作员姓名
|
|
|
});
|
|
@@ -9457,7 +9494,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
throw new WarehouseException(responseVo.getMessage().get("msg"));
|
|
|
}
|
|
|
//修改订单信息
|
|
|
- tWarehouseBills.getOrderList().stream().forEach(item ->{
|
|
|
+ tWarehouseBills.getOrderList().stream().forEach(item -> {
|
|
|
//修改订单信息
|
|
|
TWarehouseBills bills = new TWarehouseBills();
|
|
|
bills.setfId(item);
|
|
@@ -9540,6 +9577,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
}
|
|
|
return buff;
|
|
|
}
|
|
|
+
|
|
|
//测试设备单新增 接口
|
|
|
public static void main(String[] args) {
|
|
|
List<JoabBoxVo> list = new ArrayList<>();
|