Merge branch 'dev_20260429' into dev_WMS20260401
# Conflicts: # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteOmsFeignFallbackFactory.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteUserFeignFallbackFactory.java # mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/batchDetail/BatchDetailApplicationService.java # mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/batchDetail/service/BatchDetailDomainService.java # mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/sysTableConfig/SysTableConfigApi.java
This commit is contained in:
+192
-1
@@ -1,21 +1,39 @@
|
||||
package com.mhd.oms.application.service.businessDocumentOrder;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.oms.domain.businessDocumentCargoMulti.entity.BusinessDocumentCargoMulti;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.todo.BusinessDocumentOrderDO;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.service.BusinessDocumentOrderDomainService;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.businessOrderAccount.BusinessOrderAccount;
|
||||
import com.mhd.oms.domain.businessOrderAccount.repository.mapper.BusinessOrderAccountMapper;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentOrder.BusinessDocumentOrderDTO;
|
||||
import com.mhd.oms.interfaces.dto.originalImportExportDocument.OrderWithMaterialDTO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.ehcache.shadow.org.terracotta.context.extractor.ObjectContextExtractor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】ApplicationService
|
||||
*
|
||||
@@ -25,6 +43,12 @@ import java.util.List;
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusinessDocumentOrderApplicationService {
|
||||
|
||||
private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData";
|
||||
private static final String API_NAME_I = "saveBill_i";
|
||||
private static final String API_NAME_E = "saveBill_e";
|
||||
private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP";
|
||||
|
||||
@Autowired
|
||||
private BusinessDocumentOrderDomainService businessDocumentOrderDomainService;
|
||||
|
||||
@@ -32,6 +56,12 @@ public class BusinessDocumentOrderApplicationService {
|
||||
private BusinessOrderAccountMapper businessOrderAccountMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
||||
|
||||
@Resource
|
||||
private GwLogMapper gwLogMapper;
|
||||
|
||||
/**
|
||||
* 分页查询【请填写功能名称】列表
|
||||
*/
|
||||
@@ -102,4 +132,165 @@ public class BusinessDocumentOrderApplicationService {
|
||||
List<BusinessOrderAccount> businessOrderAccounts = businessOrderAccountMapper.selectList(new LambdaQueryWrapper<BusinessOrderAccount>().eq(BusinessOrderAccount::getOrderId, id).eq(BusinessOrderAccount::getIsDelete, 0));
|
||||
return businessOrderAccounts;
|
||||
}
|
||||
|
||||
public List<BusinessDocumentOrderPO> queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
businessDocumentOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
}
|
||||
return businessDocumentOrderDomainService.queryListAndMaterial(businessDocumentOrderDO);
|
||||
}
|
||||
|
||||
public void reviseApply(BusinessDocumentOrderDTO businessDocumentOrderDTO) {
|
||||
BusinessDocumentOrder businessDocumentOrder = new BusinessDocumentOrder();
|
||||
BeanUtils.copyProperties(businessDocumentOrder,businessDocumentOrderDTO);
|
||||
businessDocumentOrderMapper.updateById(businessDocumentOrder);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public AjaxResult batchPushForOriginalImportExportDocument(List<BusinessDocumentOrderDTO> businessDocumentOrderDTOList) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long pushBy = loginUser != null ? loginUser.getUserid() : null;
|
||||
String pushByName = loginUser != null ? loginUser.getUsername() : null;
|
||||
Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null;
|
||||
Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null;
|
||||
String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null;
|
||||
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
StringBuilder failMsg = new StringBuilder();
|
||||
|
||||
for (BusinessDocumentOrderDTO pushData : businessDocumentOrderDTOList) {
|
||||
// 1. 构建推送数据
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
body.put("erpBillNo", String.valueOf(pushData.getId()));
|
||||
body.put("billDate", pushData.getDocumentDate());
|
||||
body.put("goodsType", pushData.getGoodsType());
|
||||
body.put("ieFlag", pushData.getIeType() != null ? String.valueOf(pushData.getIeType()) : null);
|
||||
body.put("corpCode", pushData.getAppointShipperId() != null ? pushData.getAppointShipperId().toString() : null);
|
||||
|
||||
List<Map<String, Object>> billList = new ArrayList<>();
|
||||
int gNo = 1;
|
||||
for(OrderWithMaterialDTO orderWithMaterialDTO : pushData.getOrderWithMaterialDTOList()){
|
||||
Map<String, Object> billMap = new HashMap<>();
|
||||
billMap.put("gNo", gNo++);
|
||||
billMap.put("goodsCode", orderWithMaterialDTO.getMaterialCode() != null ? orderWithMaterialDTO.getMaterialCode().toString() : null);
|
||||
billMap.put("netWt", orderWithMaterialDTO.getWeightLimit());
|
||||
billMap.put("grossWt", orderWithMaterialDTO.getGrossWeight());
|
||||
billMap.put("packNo", orderWithMaterialDTO.getCargoNum());
|
||||
billMap.put("erpQty", orderWithMaterialDTO.getCargoNum());
|
||||
billList.add(billMap);
|
||||
}
|
||||
body.put("billList",billList);
|
||||
|
||||
if (pushData.getId() != null) {
|
||||
updatePushStatus(pushData.getId(), 2, null, String.valueOf(pushBy), pushByName);
|
||||
}
|
||||
|
||||
|
||||
// 2. 记录日志
|
||||
GwLog gwLog = new GwLog();
|
||||
gwLog.setType("进出口原始单证");
|
||||
gwLog.setBusinessId(Long.valueOf(pushData.getId()));
|
||||
gwLog.setRequestBody(JSONObject.toJSONString(body));
|
||||
gwLog.setResponseBody("");
|
||||
gwLog.setStatus(1);
|
||||
gwLog.setSendTime(new Date());
|
||||
gwLog.setOrganizationId(organizationId);
|
||||
gwLog.setTopOrganizationId(topOrganizationId);
|
||||
gwLog.setOrganizationName(organizationName);
|
||||
gwLog.setCreateBy(pushBy);
|
||||
gwLog.setCreateTime(new Date());
|
||||
gwLog.setDelFlag(1);
|
||||
gwLogMapper.insert(gwLog);
|
||||
|
||||
// 3. 调用推送接口
|
||||
try {
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(PUSH_API_URL);
|
||||
StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8");
|
||||
httpPost.setEntity(postingString);
|
||||
|
||||
httpPost.setHeader("Content-type", "application/json");
|
||||
httpPost.setHeader("verify", VERIFY);
|
||||
if(pushData.getIeType().equals("I"))
|
||||
{
|
||||
httpPost.setHeader("apiName", API_NAME_I);
|
||||
}
|
||||
else if (pushData.getIeType().equals("E")) {
|
||||
httpPost.setHeader("apiName", API_NAME_E);
|
||||
}else{
|
||||
AjaxResult.error("进出口方式错误");
|
||||
}
|
||||
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
String responseString = EntityUtils.toString(response.getEntity());
|
||||
gwLog.setResponseBody(responseString);
|
||||
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
gwLog.setStatus(2);
|
||||
if (pushData.getId() != null) {
|
||||
updatePushStatus(pushData.getId(), 3, new Date(), String.valueOf(pushBy), pushByName);
|
||||
}
|
||||
successCount++;
|
||||
} else {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(responseString);
|
||||
if (pushData.getId() != null) {
|
||||
updatePushStatus(pushData.getId(), 4, new Date(), String.valueOf(pushBy), pushByName);
|
||||
}
|
||||
failCount++;
|
||||
failMsg.append("物料编码:").append(pushData.getMaterialCode()).append("失败:");
|
||||
}
|
||||
gwLogMapper.updateById(gwLog);
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(e.getMessage());
|
||||
gwLog.setResponseBody("请求异常:" + e.getMessage());
|
||||
gwLogMapper.updateById(gwLog);
|
||||
if (pushData.getId() != null) {
|
||||
updatePushStatus(pushData.getId(), 4, new Date(), String.valueOf(pushBy), pushByName);
|
||||
}
|
||||
failCount++;
|
||||
failMsg.append("物料编码:").append(pushData.getMaterialCode()).append("异常:").append(e.getMessage());
|
||||
log.error("GW推送异常:materialCode={}, error={}", pushData.getMaterialCode(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
String resultMsg = "推送完成:成功" + successCount + "条,失败" + failCount + "条";
|
||||
if (failCount > 0) {
|
||||
resultMsg += "[" + failMsg.toString() + "]";
|
||||
}
|
||||
return AjaxResult.success(resultMsg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void updatePushStatus(Long id, Integer pushStatus, Date pushTime, String pushBy, String pushByName) {
|
||||
try {
|
||||
BusinessDocumentOrder update = new BusinessDocumentOrder();
|
||||
update.setId(id);
|
||||
update.setPushStatus(pushStatus);
|
||||
if (pushTime != null) {
|
||||
update.setPushTime(pushTime);
|
||||
}
|
||||
if (pushBy != null) {
|
||||
update.setPushBy(pushBy);
|
||||
}
|
||||
if (pushByName != null) {
|
||||
update.setPushByName(pushByName);
|
||||
}
|
||||
businessDocumentOrderMapper.updateById(update);
|
||||
} catch (Exception e) {
|
||||
log.error("更新推送状态失败: id={}, error={}", id, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
package com.mhd.oms.application.service.businessPartner;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper;
|
||||
import com.mhd.oms.interfaces.dto.businessPartner.BusinessPartnerDTO;
|
||||
import com.mhd.system.api.UserServiceFeign;
|
||||
import com.mhd.system.api.domain.UserShipperQueryDTO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusinessPartnerApplicationService {
|
||||
|
||||
private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData";
|
||||
private static final String API_NAME = "saveCorporation";
|
||||
private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP";
|
||||
|
||||
|
||||
@Resource
|
||||
private UserServiceFeign userServiceFeign;
|
||||
|
||||
@Resource
|
||||
private GwLogMapper gwLogMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public TableDataInfo queryShipperPage(BusinessPartnerDTO businessPartnerDTO) {
|
||||
UserShipperQueryDTO userShipperQueryDTO = new UserShipperQueryDTO();
|
||||
BeanUtils.copyProperties(businessPartnerDTO,userShipperQueryDTO);
|
||||
if(businessPartnerDTO.getOrganizationId()!=null){
|
||||
userShipperQueryDTO.setOrganizationId(String.valueOf(businessPartnerDTO.getOrganizationId()));
|
||||
}
|
||||
|
||||
try {
|
||||
TableDataInfo userTableDataInfo = userServiceFeign.userShipperList(userShipperQueryDTO);
|
||||
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(userTableDataInfo.getData());
|
||||
tableDataInfo.setTotal(userTableDataInfo.getTotal());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
} catch (Exception e) {
|
||||
log.error("查询托运人列表异常: {}", e.getMessage());
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setCode(500);
|
||||
return tableDataInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public AjaxResult batchPush(List<BusinessPartnerDTO> businessPartnerDTOList) {
|
||||
if(businessPartnerDTOList == null || businessPartnerDTOList.isEmpty()){
|
||||
return AjaxResult.error("没有数据需要推送");
|
||||
}
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long pushBy = loginUser != null ? loginUser.getUserid() : null;
|
||||
String pushByName = loginUser != null ? loginUser.getUsername() : null;
|
||||
Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null;
|
||||
Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null;
|
||||
String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null;
|
||||
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
StringBuilder failMsg = new StringBuilder();
|
||||
|
||||
for (BusinessPartnerDTO businessPartnerDTO :businessPartnerDTOList){
|
||||
|
||||
Map<String, String> body = new HashMap<>();
|
||||
body.put("copyCode",businessPartnerDTO.getCorpCode());
|
||||
body.put("copyName",businessPartnerDTO.getCorpName());
|
||||
|
||||
GwLog gwLog = new GwLog();
|
||||
gwLog.setType("商业合作伙伴");
|
||||
gwLog.setBusinessId(Long.valueOf(businessPartnerDTO.getShipperId()));
|
||||
gwLog.setRequestBody(JSONObject.toJSONString(body));
|
||||
gwLog.setResponseBody("");
|
||||
gwLog.setStatus(1);
|
||||
gwLog.setSendTime(new Date());
|
||||
gwLog.setOrganizationId(organizationId);
|
||||
gwLog.setTopOrganizationId(topOrganizationId);
|
||||
gwLog.setOrganizationName(organizationName);
|
||||
gwLog.setCreateBy(pushBy);
|
||||
gwLog.setCreateTime(new Date());
|
||||
gwLog.setDelFlag(1);
|
||||
gwLogMapper.insert(gwLog);
|
||||
|
||||
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),2,new Date(),pushBy,pushByName);
|
||||
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(PUSH_API_URL);
|
||||
StringEntity postingString = new StringEntity(JSONObject.toJSONString(body),"UTF-8");
|
||||
httpPost.setEntity(postingString);
|
||||
httpPost.setHeader("Content-type", "application/json");
|
||||
httpPost.setHeader("apiName", API_NAME);
|
||||
httpPost.setHeader("verify", VERIFY);
|
||||
try{
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
String responseString = EntityUtils.toString(response.getEntity());
|
||||
gwLog.setResponseBody(responseString);
|
||||
|
||||
if(response.getStatusLine().getStatusCode() == 200){
|
||||
gwLog.setStatus(2);
|
||||
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),3, new Date(), pushBy,pushByName);
|
||||
successCount++;
|
||||
}else{
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(responseString);
|
||||
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName);
|
||||
failCount++;
|
||||
failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("失败:");
|
||||
}
|
||||
gwLogMapper.updateById(gwLog);
|
||||
response.close();
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(e.getMessage());
|
||||
gwLog.setResponseBody("请求异常:" + e.getMessage());
|
||||
gwLogMapper.updateById(gwLog);
|
||||
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName);
|
||||
failCount++;
|
||||
failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("异常:").append(e.getMessage()).append(":");
|
||||
log.error("GW推送异常:shipperId={}, error={}",businessPartnerDTO.getShipperId(),e.getMessage());
|
||||
|
||||
} finally {
|
||||
try{
|
||||
httpClient.close();
|
||||
}catch (Exception e){
|
||||
log.error("关闭httpClient异常:{}" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String resultMsg = "推送完成:成功" + successCount + "条,失败" + failCount +"条";
|
||||
if(failCount > 0){
|
||||
resultMsg += "[" + failMsg.toString() + "]";
|
||||
}
|
||||
|
||||
return AjaxResult.success(resultMsg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void updatePushStatus(Long shipperId, Integer pushStatus, Date pushTime, Long pushBy,String pushByName) {
|
||||
try {
|
||||
// 调用user-center的Feign接口,更新货主的推送状态
|
||||
String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null;
|
||||
AjaxResult result = userServiceFeign.updatePushStatus(shipperId, pushStatus, pushTimeStr, pushBy, pushByName);
|
||||
log.info("更新返回结果:{}",result);
|
||||
} catch (Exception e) {
|
||||
// 如果更新失败,记录错误日志,但不阻断主流程
|
||||
log.info("更新推送状态失败: shipperId={}, error={}", shipperId, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
package com.mhd.oms.application.service.erpCountry;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.erpCountry.entity.ErpCountry;
|
||||
import com.mhd.oms.domain.erpCountry.repository.mapper.ErpCountryMapper;
|
||||
import com.mhd.oms.domain.erpCountry.repository.po.ErpCountryPO;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper;
|
||||
import com.mhd.oms.interfaces.dto.erpCountry.ErpCountryDTO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ErpCountryApplicationService{
|
||||
private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData";
|
||||
private static final String API_NAME = "saveCountry";
|
||||
private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP";
|
||||
|
||||
@Resource
|
||||
private ErpCountryMapper erpCountryMapper;
|
||||
|
||||
@Resource
|
||||
private GwLogMapper gwLogMapper;
|
||||
|
||||
public TableDataInfo queryList(ErpCountryDTO erpCountryDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1) {
|
||||
erpCountryDTO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
}
|
||||
PageHelper.startPage(erpCountryDTO.getPageNum(),erpCountryDTO.getPageSize());
|
||||
List<ErpCountryPO> list = erpCountryMapper.queryList(erpCountryDTO);
|
||||
|
||||
Page<ErpCountryPO> page = (Page<ErpCountryPO>) list;
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(list);
|
||||
tableDataInfo.setTotal(page.getTotal());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public int insert(ErpCountryDTO erpCountryDTO) {
|
||||
ErpCountry erpCountry = new ErpCountry();
|
||||
BeanUtils.copyProperties(erpCountryDTO, erpCountry);
|
||||
erpCountry.setPushStatus(1);
|
||||
erpCountry.setDelFlag(1);
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
erpCountry.setCreateBy(loginUser.getUserid());
|
||||
erpCountry.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
erpCountry.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
erpCountry.setCreateTime(new Date());
|
||||
return erpCountryMapper.insert(erpCountry);
|
||||
}
|
||||
|
||||
public int update(ErpCountryDTO erpCountryDTO) {
|
||||
ErpCountry erpCountry = new ErpCountry();
|
||||
BeanUtils.copyProperties(erpCountryDTO, erpCountry);
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
erpCountry.setUpdateBy(loginUser.getUserid());
|
||||
erpCountry.setUpdateTime(new Date());
|
||||
}
|
||||
return erpCountryMapper.updateById(erpCountry);
|
||||
}
|
||||
|
||||
public int deleteByIds(List<Long> idList) {
|
||||
return erpCountryMapper.deleteByIds(idList);
|
||||
}
|
||||
|
||||
public AjaxResult batchPush(List<ErpCountryDTO> dtoList) {
|
||||
if (dtoList == null || dtoList.isEmpty()) {
|
||||
return AjaxResult.error("没有数据需要推送");
|
||||
}
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long pushBy = loginUser != null ? loginUser.getUserid() : null;
|
||||
String pushByName = loginUser != null ? loginUser.getUsername() : null;
|
||||
Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null;
|
||||
Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null;
|
||||
String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null;
|
||||
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
StringBuilder failMsg = new StringBuilder();
|
||||
|
||||
for (ErpCountryDTO dto : dtoList) {
|
||||
Map<String, String> body = new HashMap<>();
|
||||
body.put("erpCountryCode", dto.getErpCountryCode());
|
||||
body.put("erpCountryName", dto.getErpCountryName());
|
||||
|
||||
GwLog gwLog = new GwLog();
|
||||
gwLog.setType("企业国别");
|
||||
gwLog.setBusinessId(dto.getId());
|
||||
gwLog.setRequestBody(JSONObject.toJSONString(body));
|
||||
gwLog.setResponseBody("");
|
||||
gwLog.setStatus(1);
|
||||
gwLog.setSendTime(new Date());
|
||||
gwLog.setOrganizationId(organizationId);
|
||||
gwLog.setTopOrganizationId(topOrganizationId);
|
||||
gwLog.setOrganizationName(organizationName);
|
||||
gwLog.setCreateBy(pushBy);
|
||||
gwLog.setCreateTime(new Date());
|
||||
gwLog.setDelFlag(1);
|
||||
gwLogMapper.insert(gwLog);
|
||||
|
||||
updatePushStatus(dto.getId(), 2, new Date(), pushBy,pushByName);
|
||||
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(PUSH_API_URL);
|
||||
StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8");
|
||||
httpPost.setEntity(postingString);
|
||||
httpPost.setHeader("Content-type", "application/json");
|
||||
httpPost.setHeader("apiName", API_NAME);
|
||||
httpPost.setHeader("verify", VERIFY);
|
||||
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
String responseString = EntityUtils.toString(response.getEntity());
|
||||
gwLog.setResponseBody(responseString);
|
||||
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
gwLog.setStatus(2);
|
||||
updatePushStatus(dto.getId(), 3, new Date(), pushBy,pushByName);
|
||||
successCount++;
|
||||
} else {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(responseString);
|
||||
updatePushStatus(dto.getId(), 4, new Date(), pushBy,pushByName);
|
||||
failCount++;
|
||||
failMsg.append("erpCountryCode:").append(dto.getErpCountryCode()).append("失败;");
|
||||
}
|
||||
gwLogMapper.updateById(gwLog);
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(e.getMessage());
|
||||
gwLog.setResponseBody("请求异常:" + e.getMessage());
|
||||
gwLogMapper.updateById(gwLog);
|
||||
updatePushStatus(dto.getId(), 4, new Date(), pushBy,pushByName);
|
||||
failCount++;
|
||||
failMsg.append("erpCountryCode:").append(dto.getErpCountryCode()).append("异常:").append(e.getMessage()).append(";");
|
||||
log.error("企业国别推送异常: id={}, error={}", dto.getId(), e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
httpClient.close();
|
||||
} catch (Exception e) {
|
||||
log.error("关闭httpClient异常: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条";
|
||||
if (failCount > 0) {
|
||||
resultMsg += "[" + failMsg.toString() + "]";
|
||||
}
|
||||
return AjaxResult.success(resultMsg);
|
||||
}
|
||||
|
||||
private void updatePushStatus(Long id, Integer pushStatus, Date pushTime, Long pushBy,String pushByName) {
|
||||
ErpCountry entity = new ErpCountry();
|
||||
entity.setId(id);
|
||||
entity.setPushStatus(pushStatus);
|
||||
if (pushTime != null) {
|
||||
entity.setPushTime(pushTime);
|
||||
}
|
||||
if (pushBy != null) {
|
||||
entity.setPushBy(pushBy);
|
||||
}
|
||||
if (pushByName != null) {
|
||||
entity.setPushByName(pushByName);
|
||||
}
|
||||
erpCountryMapper.updateById(entity);
|
||||
}
|
||||
|
||||
public ErpCountry getById(Long id) {
|
||||
return erpCountryMapper.selectById(id);
|
||||
}
|
||||
}
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
package com.mhd.oms.application.service.erpEnterpriseUnit;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.entity.ErpEnterpriseUnit;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.repository.mapper.ErpEnterpriseUnitMapper;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.repository.po.ErpEnterpriseUnitPO;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.repository.todo.ErpEnterpriseUnitDO;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper;
|
||||
import com.mhd.oms.interfaces.dto.erpEnterpriseUnit.ErpEnterpriseUnitDTO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ErpEnterpriseUnitApplicationService {
|
||||
|
||||
private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData";
|
||||
private static final String API_NAME = "saveUnit";
|
||||
private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP";
|
||||
|
||||
@Resource
|
||||
private ErpEnterpriseUnitMapper erpEnterpriseUnitMapper;
|
||||
|
||||
@Resource
|
||||
private GwLogMapper gwLogMapper;
|
||||
|
||||
public TableDataInfo queryList(ErpEnterpriseUnitDO erpEnterpriseUnitDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1) {
|
||||
erpEnterpriseUnitDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
}
|
||||
PageHelper.startPage(erpEnterpriseUnitDO.getPageNum(),erpEnterpriseUnitDO.getPageSize());
|
||||
List<ErpEnterpriseUnitPO> list = erpEnterpriseUnitMapper.queryList(erpEnterpriseUnitDO);
|
||||
Page<ErpEnterpriseUnitPO> page = (Page<ErpEnterpriseUnitPO>) list;
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(list);
|
||||
tableDataInfo.setTotal(page.getTotal());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
public int update(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO) {
|
||||
ErpEnterpriseUnit erpEnterpriseUnit = new ErpEnterpriseUnit();
|
||||
BeanUtils.copyProperties(erpEnterpriseUnitDTO,erpEnterpriseUnit);
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if(loginUser != null){
|
||||
erpEnterpriseUnit.setUpdateBy(loginUser.getUserid());
|
||||
erpEnterpriseUnit.setUpdateTime(new Date());
|
||||
}
|
||||
return erpEnterpriseUnitMapper.updateById(erpEnterpriseUnit);
|
||||
}
|
||||
|
||||
public int insert(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO) {
|
||||
ErpEnterpriseUnit erpEnterpriseUnit = new ErpEnterpriseUnit();
|
||||
BeanUtils.copyProperties(erpEnterpriseUnitDTO,erpEnterpriseUnit);
|
||||
erpEnterpriseUnit.setPushStatus(1);
|
||||
erpEnterpriseUnit.setDelFlag(1);
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if(loginUser != null){
|
||||
erpEnterpriseUnit.setCreateBy(loginUser.getUserid());
|
||||
//erpEnterpriseUnit.setCreateTime(new Date());
|
||||
erpEnterpriseUnit.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
erpEnterpriseUnit.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
erpEnterpriseUnit.setCreateTime(new Date());
|
||||
return erpEnterpriseUnitMapper.insert(erpEnterpriseUnit);
|
||||
|
||||
}
|
||||
|
||||
public AjaxResult batchPush(List<ErpEnterpriseUnitDTO> dtoList) {
|
||||
if (dtoList == null || dtoList.isEmpty()) {
|
||||
return AjaxResult.error("没有数据需要推送");
|
||||
}
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long pushBy = loginUser != null ? loginUser.getUserid() : null;
|
||||
String pushByName = loginUser != null ? loginUser.getUsername() : null;
|
||||
Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null;
|
||||
Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null;
|
||||
String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null;
|
||||
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
StringBuilder failMsg = new StringBuilder();
|
||||
|
||||
for (ErpEnterpriseUnitDTO dto : dtoList) {
|
||||
Map<String, String> body = new HashMap<>();
|
||||
body.put("erpUnitCode", dto.getErpCode());
|
||||
body.put("erpUnitName", dto.getErpName());
|
||||
|
||||
GwLog gwLog = new GwLog();
|
||||
gwLog.setType("企业单位");
|
||||
gwLog.setBusinessId(Long.valueOf(dto.getId()));
|
||||
gwLog.setRequestBody(JSONObject.toJSONString(body));
|
||||
gwLog.setResponseBody("");
|
||||
gwLog.setStatus(1);
|
||||
gwLog.setSendTime(new Date());
|
||||
gwLog.setOrganizationId(organizationId);
|
||||
gwLog.setTopOrganizationId(topOrganizationId);
|
||||
gwLog.setOrganizationName(organizationName);
|
||||
gwLog.setCreateBy(pushBy);
|
||||
gwLog.setCreateTime(new Date());
|
||||
gwLog.setDelFlag(1);
|
||||
gwLogMapper.insert(gwLog);
|
||||
|
||||
updatePushStatus(dto.getId(), 2, new Date(), pushBy,pushByName);
|
||||
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(PUSH_API_URL);
|
||||
StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8");
|
||||
httpPost.setEntity(postingString);
|
||||
httpPost.setHeader("Content-type", "application/json");
|
||||
httpPost.setHeader("apiName", API_NAME);
|
||||
httpPost.setHeader("verify", VERIFY);
|
||||
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
String responseString = EntityUtils.toString(response.getEntity());
|
||||
gwLog.setResponseBody(responseString);
|
||||
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
gwLog.setStatus(2);
|
||||
updatePushStatus(dto.getId(), 3, new Date(), pushBy,pushByName);
|
||||
successCount++;
|
||||
} else {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(responseString);
|
||||
updatePushStatus(dto.getId(), 4, new Date(), pushBy,pushByName);
|
||||
failCount++;
|
||||
failMsg.append("erpUnitCode:").append(dto.getErpCode()).append("失败;");
|
||||
}
|
||||
gwLogMapper.updateById(gwLog);
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(e.getMessage());
|
||||
gwLog.setResponseBody("请求异常:" + e.getMessage());
|
||||
gwLogMapper.updateById(gwLog);
|
||||
updatePushStatus(dto.getId(), 4, new Date(), pushBy,pushByName);
|
||||
failCount++;
|
||||
failMsg.append("erpUnitCode:").append(dto.getErpCode()).append("异常:").append(e.getMessage()).append(";");
|
||||
log.error("企业单位推送异常: id={}, error={}", dto.getId(), e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
httpClient.close();
|
||||
} catch (Exception e) {
|
||||
log.error("关闭httpClient异常: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条";
|
||||
if (failCount > 0) {
|
||||
resultMsg += "[" + failMsg.toString() + "]";
|
||||
}
|
||||
return AjaxResult.success(resultMsg);
|
||||
}
|
||||
|
||||
private void updatePushStatus(Long id, Integer pushStatus, Date pushTime, Long pushBy ,String pushByName) {
|
||||
ErpEnterpriseUnit entity = new ErpEnterpriseUnit();
|
||||
entity.setId(id);
|
||||
entity.setPushStatus(pushStatus);
|
||||
if (pushTime != null) {
|
||||
entity.setPushTime(pushTime);
|
||||
}
|
||||
if (pushBy != null) {
|
||||
entity.setPushBy(String.valueOf(pushBy));
|
||||
}
|
||||
if (pushByName != null) {
|
||||
entity.setPushByName((pushByName));
|
||||
}
|
||||
erpEnterpriseUnitMapper.updateById(entity);
|
||||
}
|
||||
|
||||
public int deleteByIds(List<Long> idList) {
|
||||
if(idList == null || idList.isEmpty()){
|
||||
return 0;
|
||||
}
|
||||
return erpEnterpriseUnitMapper.deleteByIds(idList);
|
||||
}
|
||||
|
||||
public ErpEnterpriseUnit getById(Long id) {
|
||||
return erpEnterpriseUnitMapper.selectById(id);
|
||||
}
|
||||
}
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
package com.mhd.oms.application.service.exchangeRate;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper;
|
||||
import com.mhd.oms.interfaces.dto.exchangeRate.ExchangeRateDTO;
|
||||
import com.mhd.system.api.WlhyServiceFeign;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ExchangeRateApplicationService {
|
||||
|
||||
private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData";
|
||||
private static final String API_NAME = "saveCurr";
|
||||
private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP";
|
||||
|
||||
@Resource
|
||||
private WlhyServiceFeign wlhyServiceFeign;
|
||||
|
||||
@Resource
|
||||
private GwLogMapper gwLogMapper;
|
||||
|
||||
public TableDataInfo queryExchangeRateList(Integer pageNum, Integer pageSize, String pushStatus, String organizationId) {
|
||||
try {
|
||||
log.info("查询汇率列表: pageNum={}, pageSize={}, pushStatus={}, organizationId={}",
|
||||
pageNum, pageSize, pushStatus, organizationId);
|
||||
AjaxResult<?> result = wlhyServiceFeign.queryList(pageNum, pageSize, pushStatus, organizationId);
|
||||
log.info("查询汇率列表结果: code={}, result={}", result.get("code"), result.get("result"));
|
||||
|
||||
if (result != null) {
|
||||
Object wlhyResult = result.get("result");
|
||||
if (wlhyResult != null) {
|
||||
Map<?, ?> map = (Map<?, ?>) wlhyResult;
|
||||
Object records = map.get("records");
|
||||
Object total = map.get("total");
|
||||
List<?> list = records instanceof List ? (List<?>) records : new ArrayList<>();
|
||||
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(list);
|
||||
tableDataInfo.setTotal(total instanceof Number ? ((Number) total).longValue() : list.size());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询汇率列表异常: {}", e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return buildTableDataInfo(new ArrayList<>());
|
||||
}
|
||||
|
||||
private TableDataInfo buildTableDataInfo(List<?> list) {
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(list);
|
||||
tableDataInfo.setTotal(list.size());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public AjaxResult batchPushExchangeRate(List<ExchangeRateDTO> exchangeRateDTOList) {
|
||||
if (exchangeRateDTOList == null || exchangeRateDTOList.isEmpty()) {
|
||||
return AjaxResult.error("没有数据需要推送");
|
||||
}
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long pushBy = loginUser != null ? loginUser.getUserid() : null;
|
||||
String pushByName = loginUser != null ? loginUser.getUsername() : null;
|
||||
Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null;
|
||||
Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null;
|
||||
String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null;
|
||||
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
StringBuilder failMsg = new StringBuilder();
|
||||
|
||||
for (ExchangeRateDTO dto : exchangeRateDTOList) {
|
||||
Map<String, String> body = new HashMap<>();
|
||||
body.put("erpCurrCode", dto.getErpCurrCode());
|
||||
body.put("erpCurrName", dto.getErpCurrName());
|
||||
|
||||
GwLog gwLog = new GwLog();
|
||||
gwLog.setType("汇率管理");
|
||||
gwLog.setBusinessId(Long.valueOf(dto.getId()));
|
||||
gwLog.setRequestBody(JSONObject.toJSONString(body));
|
||||
gwLog.setResponseBody("");
|
||||
gwLog.setStatus(1);
|
||||
gwLog.setSendTime(new Date());
|
||||
gwLog.setOrganizationId(organizationId);
|
||||
gwLog.setTopOrganizationId(topOrganizationId);
|
||||
gwLog.setOrganizationName(organizationName);
|
||||
gwLog.setCreateBy(pushBy);
|
||||
gwLog.setCreateTime(new Date());
|
||||
gwLog.setDelFlag(1);
|
||||
gwLogMapper.insert(gwLog);
|
||||
|
||||
// 更新为推送中
|
||||
updateExchangeRatePushStatus(dto.getId(), 2, new Date(), pushBy, pushByName);
|
||||
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(PUSH_API_URL);
|
||||
StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8");
|
||||
httpPost.setEntity(postingString);
|
||||
httpPost.setHeader("Content-type", "application/json");
|
||||
httpPost.setHeader("apiName", API_NAME);
|
||||
httpPost.setHeader("verify", VERIFY);
|
||||
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
String responseString = EntityUtils.toString(response.getEntity());
|
||||
gwLog.setResponseBody(responseString);
|
||||
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
gwLog.setStatus(2);
|
||||
updateExchangeRatePushStatus(dto.getId(), 3, new Date(), pushBy, pushByName);
|
||||
successCount++;
|
||||
} else {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(responseString);
|
||||
updateExchangeRatePushStatus(dto.getId(), 4, new Date(), pushBy, pushByName);
|
||||
failCount++;
|
||||
failMsg.append("erpCurrCode:").append(dto.getErpCurrCode()).append("失败;");
|
||||
}
|
||||
gwLogMapper.updateById(gwLog);
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(e.getMessage());
|
||||
gwLog.setResponseBody("请求异常:" + e.getMessage());
|
||||
gwLogMapper.updateById(gwLog);
|
||||
updateExchangeRatePushStatus(dto.getId(), 4, new Date(), pushBy, pushByName);
|
||||
failCount++;
|
||||
failMsg.append("erpCurrCode:").append(dto.getErpCurrCode()).append("异常:").append(e.getMessage()).append(";");
|
||||
log.error("汇率推送异常: id={}, error={}", dto.getId(), e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
httpClient.close();
|
||||
} catch (Exception e) {
|
||||
log.error("关闭httpClient异常: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条";
|
||||
if (failCount > 0) {
|
||||
resultMsg += "[" + failMsg.toString() + "]";
|
||||
}
|
||||
return AjaxResult.success(resultMsg);
|
||||
}
|
||||
|
||||
private void updateExchangeRatePushStatus(String id, Integer pushStatus, Date pushTime, Long pushBy, String pushByName) {
|
||||
try {
|
||||
String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null;
|
||||
wlhyServiceFeign.updateExchangeRatePushStatus(id, pushStatus, pushTimeStr, pushBy, pushByName);
|
||||
} catch (Exception e) {
|
||||
log.error("更新汇率推送状态失败: id={}, error={}", id, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.mhd.oms.application.service.gwLog;
|
||||
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper;
|
||||
import com.mhd.oms.domain.gwLog.repository.po.GwLogPO;
|
||||
import com.mhd.oms.interfaces.dto.gwLog.GwLogDTO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class GwLogApplicationService {
|
||||
|
||||
|
||||
private final GwLogMapper gwLogMapper;
|
||||
|
||||
public GwLogApplicationService(GwLogMapper gwLogMapper) {
|
||||
this.gwLogMapper = gwLogMapper;
|
||||
}
|
||||
|
||||
public TableDataInfo queryList(GwLogDTO gwLogDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
gwLogDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
}
|
||||
PageHelper.startPage(gwLogDTO.getPageNum(),gwLogDTO.getPageSize());
|
||||
List<GwLogPO> list = gwLogMapper.queryList(gwLogDTO);
|
||||
Page<GwLogPO> page = (Page<GwLogPO>) list;
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(list);
|
||||
tableDataInfo.setTotal(page.getTotal());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
public GwLogPO selectByTypeAndId(GwLogDTO gwLogDTO) {
|
||||
GwLog gwLog =new GwLog();
|
||||
BeanUtils.copyProperties(gwLogDTO,gwLog);
|
||||
List<GwLogPO> po1 = gwLogMapper.selectByTypeAndId(gwLog);
|
||||
if(po1.isEmpty()){
|
||||
return null;
|
||||
}
|
||||
GwLogPO po = po1.get(0);
|
||||
return po;
|
||||
}
|
||||
}
|
||||
+178
@@ -0,0 +1,178 @@
|
||||
package com.mhd.oms.application.service.materialInfo;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper;
|
||||
import com.mhd.system.api.WmsServiceFeign;
|
||||
import com.mhd.system.api.domain.MaterialInfoDTO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MaterialInfoApplicationService {
|
||||
|
||||
private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData";
|
||||
private static final String API_NAME = "saveOrgGoods";
|
||||
private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP";
|
||||
|
||||
@Resource
|
||||
private GwLogMapper gwLogMapper;
|
||||
|
||||
private final WmsServiceFeign wmsServiceFeign;
|
||||
|
||||
public MaterialInfoApplicationService(WmsServiceFeign wmsServiceFeign) {
|
||||
this.wmsServiceFeign = wmsServiceFeign;
|
||||
}
|
||||
|
||||
public TableDataInfo queryList(MaterialInfoDTO materialInfoDTO) {
|
||||
try {
|
||||
|
||||
TableDataInfo wmsTableDataInfo = wmsServiceFeign.getMaterialBaseInfoList(materialInfoDTO);
|
||||
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(wmsTableDataInfo.getData());
|
||||
tableDataInfo.setTotal(wmsTableDataInfo.getTotal());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
} catch (Exception e) {
|
||||
log.error("查询物料列表异常: {}", e.getMessage());
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setCode(500);
|
||||
return tableDataInfo;
|
||||
}
|
||||
}
|
||||
|
||||
public AjaxResult batchPush(List<MaterialInfoDTO> dtoList) {
|
||||
if (dtoList == null || dtoList.isEmpty()) {
|
||||
return AjaxResult.error("没有数据需要推送");
|
||||
}
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long pushBy = loginUser != null ? loginUser.getUserid() : null;
|
||||
String pushByName = loginUser != null ? loginUser.getUsername() : null;
|
||||
Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null;
|
||||
Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null;
|
||||
String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null;
|
||||
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
StringBuilder failMsg = new StringBuilder();
|
||||
|
||||
for (MaterialInfoDTO dto : dtoList) {
|
||||
Map<String, String> body = new HashMap<>();
|
||||
body.put("goodsCode", dto.getMaterialCode());
|
||||
|
||||
String goodsTypeString;
|
||||
if(dto.getGoodsType() == 0){
|
||||
goodsTypeString = "0";
|
||||
}else if(dto.getGoodsType() == 1){
|
||||
goodsTypeString = "1";
|
||||
}else if(dto.getGoodsType() == 2){
|
||||
goodsTypeString = "2";
|
||||
}else{
|
||||
throw new ServiceException("货物类型不存在");
|
||||
}
|
||||
body.put("goodsType", goodsTypeString);
|
||||
body.put("erpName", dto.getMaterialName());
|
||||
|
||||
|
||||
GwLog gwLog = new GwLog();
|
||||
gwLog.setType("物料管理");
|
||||
gwLog.setBusinessId(dto.getMaterialBaseInfoId());
|
||||
gwLog.setRequestBody(JSONObject.toJSONString(body));
|
||||
gwLog.setResponseBody("");
|
||||
gwLog.setStatus(1);
|
||||
gwLog.setSendTime(new Date());
|
||||
gwLog.setOrganizationId(organizationId);
|
||||
gwLog.setTopOrganizationId(topOrganizationId);
|
||||
gwLog.setOrganizationName(organizationName);
|
||||
gwLog.setCreateBy(pushBy);
|
||||
gwLog.setCreateTime(new Date());
|
||||
gwLog.setDelFlag(1);
|
||||
gwLogMapper.insert(gwLog);
|
||||
|
||||
updatePushStatus(dto.getMaterialBaseInfoId(), 2, new Date(), pushBy,pushByName);
|
||||
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(PUSH_API_URL);
|
||||
StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8");
|
||||
httpPost.setEntity(postingString);
|
||||
httpPost.setHeader("Content-type", "application/json");
|
||||
httpPost.setHeader("apiName", API_NAME);
|
||||
httpPost.setHeader("verify", VERIFY);
|
||||
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
String responseString = EntityUtils.toString(response.getEntity());
|
||||
gwLog.setResponseBody(responseString);
|
||||
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
gwLog.setStatus(2);
|
||||
updatePushStatus(dto.getMaterialBaseInfoId(), 3, new Date(), pushBy, pushByName);
|
||||
successCount++;
|
||||
} else {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(responseString);
|
||||
updatePushStatus(dto.getMaterialBaseInfoId(), 4, new Date(), pushBy, pushByName);
|
||||
failCount++;
|
||||
failMsg.append("materialCode:").append(dto.getMaterialCode()).append("失败;");
|
||||
}
|
||||
gwLogMapper.updateById(gwLog);
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
gwLog.setStatus(3);
|
||||
gwLog.setErrorMsg(e.getMessage());
|
||||
gwLog.setResponseBody("请求异常:" + e.getMessage());
|
||||
gwLogMapper.updateById(gwLog);
|
||||
updatePushStatus(dto.getMaterialBaseInfoId(), 4, new Date(), pushBy, pushByName);
|
||||
failCount++;
|
||||
failMsg.append("materialCode:").append(dto.getMaterialCode()).append("异常:").append(e.getMessage()).append(";");
|
||||
log.error("物料推送异常: id={}, error={}", dto.getMaterialBaseInfoId(), e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
httpClient.close();
|
||||
} catch (Exception e) {
|
||||
log.error("关闭httpClient异常: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条";
|
||||
if (failCount > 0) {
|
||||
resultMsg += "[" + failMsg.toString() + "]";
|
||||
}
|
||||
return AjaxResult.success(resultMsg);
|
||||
}
|
||||
|
||||
private void updatePushStatus(Long materialBaseInfoId, Integer pushStatus, Date pushTime, Long pushBy, String pushByName) {
|
||||
try {
|
||||
String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null;
|
||||
wmsServiceFeign.updateMaterialPushStatus(materialBaseInfoId, pushStatus, pushTimeStr, pushBy, pushByName);
|
||||
log.info("更新返回结果: materialBaseInfoId={}", materialBaseInfoId);
|
||||
} catch (Exception e) {
|
||||
log.info("更新推送状态失败: materialBaseInfoId={}, error={}", materialBaseInfoId, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
@@ -96,10 +96,16 @@ public class BusinessDocumentCargoMulti extends BaseVOEntity{
|
||||
@ApiModelProperty("")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料id")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String orderId;
|
||||
|
||||
@ApiModelProperty("货物内容")
|
||||
private String materialContent;
|
||||
|
||||
@ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)")
|
||||
private Integer productType;
|
||||
}
|
||||
|
||||
+4
@@ -62,6 +62,10 @@ public class BusinessDocumentCargoMultiPO extends BaseVOEntity{
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal cargoWeight;
|
||||
|
||||
@ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)")
|
||||
private Integer productType;
|
||||
|
||||
@ApiModelProperty("物料id")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
}
|
||||
|
||||
+6
@@ -67,4 +67,10 @@ public class BusinessDocumentCargoMultiDO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)")
|
||||
private Integer productType;
|
||||
|
||||
@ApiModelProperty("物料id")
|
||||
private Long materialBaseInfoId;
|
||||
}
|
||||
|
||||
+17
@@ -756,4 +756,21 @@ public class BusinessDocumentOrder extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty("仓库负责人电话")
|
||||
private String directorPhone;
|
||||
|
||||
@ApiModelProperty("进出口方式:I-进口,E-出口")
|
||||
private String ieType;
|
||||
|
||||
@ApiModelProperty("推送状态:1-未推送 2-推送中 3-推送成功 4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private String pushBy;
|
||||
|
||||
@ApiModelProperty("推送人姓名")
|
||||
private String pushByName;
|
||||
}
|
||||
|
||||
+2
@@ -52,4 +52,6 @@ public interface IBusinessDocumentOrderService extends IService<BusinessDocument
|
||||
String selectByMakerCodeNc(String salesmanCodeNc);
|
||||
|
||||
String selectByMakerCodeNc1(String salesmanCodeNc);
|
||||
|
||||
List<BusinessDocumentOrderPO> queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO);
|
||||
}
|
||||
|
||||
+1
@@ -23,4 +23,5 @@ public interface BusinessDocumentOrderMapper extends BaseMapper<BusinessDocument
|
||||
|
||||
String selectByMakerCodeNc1(@Param("salesmanCodeNc") String salesmanCodeNc);
|
||||
|
||||
List<BusinessDocumentOrderPO> queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO);
|
||||
}
|
||||
|
||||
+6
@@ -449,4 +449,10 @@ public class BusinessDocumentOrderImpl extends ServiceImpl<BusinessDocumentOrder
|
||||
}
|
||||
return makerCodeNc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusinessDocumentOrderPO> queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO)
|
||||
{
|
||||
return businessDocumentOrderMapper.queryListAndMaterial(businessDocumentOrderDO);
|
||||
}
|
||||
}
|
||||
|
||||
+30
@@ -765,9 +765,39 @@ public class BusinessDocumentOrderPO extends BaseVOEntity{
|
||||
@ApiModelProperty("出入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("仓库负责人")
|
||||
private String directorName;
|
||||
|
||||
@ApiModelProperty("仓库负责人电话")
|
||||
private String directorPhone;
|
||||
|
||||
@ApiModelProperty("进出口方式:I-进口,E-出口")
|
||||
private String ieType;
|
||||
|
||||
@ApiModelProperty("推送状态:1-未推送 2-推送中 3-推送成功 4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private String pushBy;
|
||||
|
||||
@ApiModelProperty("推送人姓名")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty("执行单")
|
||||
private List<ExecuteOrder> executeOrderList;
|
||||
|
||||
@ApiModelProperty("货物信息")
|
||||
private List<BusinessDocumentCargoMulti> businessDocumentCargoMultiList;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("商品类型")
|
||||
private Integer productType;
|
||||
|
||||
}
|
||||
|
||||
+38
-1
@@ -775,7 +775,7 @@ public class BusinessDocumentOrderDO extends BaseVOEntity{
|
||||
@ApiModelProperty(value = "审核意见")
|
||||
private String reviewOpinion;
|
||||
|
||||
@ApiModelProperty("订单来源")
|
||||
@ApiModelProperty("订单来源 0.运输,1.仓储")
|
||||
private String orderSource;
|
||||
|
||||
@ApiModelProperty(value = "出入库单号")
|
||||
@@ -790,6 +790,23 @@ public class BusinessDocumentOrderDO extends BaseVOEntity{
|
||||
@ApiModelProperty("仓库负责人电话")
|
||||
private String directorPhone;
|
||||
|
||||
@ApiModelProperty("进出口方式:I-进口,E-出口")
|
||||
private String ieType;
|
||||
|
||||
@ApiModelProperty("推送状态:1-未推送 2-推送中 3-推送成功 4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private String pushBy;
|
||||
|
||||
@ApiModelProperty("推送人姓名")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty("费用科目明细")
|
||||
private List<BusinessOrderAccount> businessOrderAccountList;
|
||||
|
||||
@@ -806,4 +823,24 @@ public class BusinessDocumentOrderDO extends BaseVOEntity{
|
||||
private List<BusinessDocumentAddressMultiDTO> loadingAddressList;
|
||||
@ApiModelProperty(value = "卸货地址集合")
|
||||
private List<BusinessDocumentAddressMultiDTO> unloadAddressList;
|
||||
|
||||
@ApiModelProperty(value = "单证日期起")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date documentDateStart;
|
||||
|
||||
@ApiModelProperty(value = "单证日期止")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date documentDateEnd;
|
||||
|
||||
@ApiModelProperty(value = "推送时间起")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTimeStart;
|
||||
|
||||
@ApiModelProperty(value = "推送时间止")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTimeEnd;
|
||||
}
|
||||
|
||||
+25
@@ -19,6 +19,8 @@ import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOr
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.todo.BusinessDocumentOrderDO;
|
||||
import com.mhd.oms.domain.businessOrderAccount.BusinessOrderAccount;
|
||||
import com.mhd.oms.domain.businessOrderAccount.repository.mapper.BusinessOrderAccountMapper;
|
||||
import com.mhd.oms.domain.reservationOrder.entity.ReservationOrder;
|
||||
import com.mhd.oms.domain.reservationOrder.repository.mapper.ReservationOrderMapper;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessDocumentAddressMultiDTO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentCargoMulti.BusinessDocumentCargoMultiDTO;
|
||||
@@ -64,6 +66,9 @@ public class BusinessDocumentOrderDomainService {
|
||||
|
||||
@Resource
|
||||
private BusinessOrderAccountMapper businessOrderAccountMapper;
|
||||
|
||||
@Resource
|
||||
private ReservationOrderMapper reservationOrderMapper;
|
||||
/**
|
||||
* 分页查询【请填写功能名称】列表
|
||||
*/
|
||||
@@ -564,7 +569,19 @@ public class BusinessDocumentOrderDomainService {
|
||||
tmsOrder.setTopOrganizationId(businessDocumentOrderDO.getTopOrganizationId());
|
||||
}
|
||||
// boolean istrue=businessDocumentOrderService.update(businessDocumentOrderDO);
|
||||
|
||||
int i = businessDocumentOrderMapper.updateById(tmsOrder);
|
||||
if (deliveryFreight != null && deliveryFreight.compareTo(BigDecimal.ZERO) > 0){
|
||||
List<ReservationOrder> reservationOrderList = reservationOrderMapper.selectList(new LambdaQueryWrapper<ReservationOrder>().eq(ReservationOrder::getGoodsNumber, businessDocumentOrderDO.getGoodsNumber()));
|
||||
if (ObjectUtil.isNotEmpty(reservationOrderList) && reservationOrderList.size() > 0) {
|
||||
for (ReservationOrder reservationOrder : reservationOrderList){
|
||||
reservationOrder.setDeliveryFreight(deliveryFreight);
|
||||
reservationOrderMapper.updateById(reservationOrder);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//保存货物信息及地址信息
|
||||
|
||||
saveAddress2CargoInfo(tmsOrder.getId(), allCargoList, loadingAddressList, unloadAddressList);
|
||||
@@ -623,6 +640,7 @@ public class BusinessDocumentOrderDomainService {
|
||||
tmsCargoInfo.setCargoWeight(tmsCargoInfoDTO.getWeight()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getWeight());
|
||||
tmsCargoInfo.setCargoNum(tmsCargoInfoDTO.getCargoNum()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getCargoNum());
|
||||
tmsCargoInfo.setMaterialVolume(tmsCargoInfoDTO.getMaterialVolume()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getMaterialVolume());
|
||||
tmsCargoInfo.setMaterialBaseInfoId(tmsCargoInfoDTO.getMaterialBaseInfoId());
|
||||
businessDocumentCargoMultiMapper.insert(tmsCargoInfo);
|
||||
}
|
||||
|
||||
@@ -787,4 +805,11 @@ public class BusinessDocumentOrderDomainService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<BusinessDocumentOrderPO> queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO) {
|
||||
return businessDocumentOrderService.queryListAndMaterial(businessDocumentOrderDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.mhd.oms.domain.erpCountry.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("erp_country")
|
||||
@ApiModel(description = "企业国别实体")
|
||||
public class ErpCountry implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("ERP国别编码")
|
||||
private String erpCountryCode;
|
||||
|
||||
@ApiModelProperty("ERP国别名称")
|
||||
private String erpCountryName;
|
||||
|
||||
@ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private Long pushBy;
|
||||
|
||||
@ApiModelProperty("推送人姓名")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty("所属组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("所属组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private Long createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private Long updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("删除标记:1-正常,0-删除")
|
||||
private Integer delFlag;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.mhd.oms.domain.erpCountry.repository.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.oms.domain.erpCountry.entity.ErpCountry;
|
||||
import com.mhd.oms.domain.erpCountry.repository.po.ErpCountryPO;
|
||||
import com.mhd.oms.interfaces.dto.erpCountry.ErpCountryDTO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ErpCountryMapper extends BaseMapper<ErpCountry> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param erpCountryDTO
|
||||
* @return
|
||||
*/
|
||||
List<ErpCountryPO> queryList(@Param("erpCountryDTO") ErpCountryDTO erpCountryDTO);
|
||||
|
||||
int deleteByIds(@Param("idList") List<Long> idList);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.mhd.oms.domain.erpCountry.repository.po;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ErpCountryPO {
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("ERP国别编码")
|
||||
private String erpCountryCode;
|
||||
|
||||
@ApiModelProperty("ERP国别名称")
|
||||
private String erpCountryName;
|
||||
|
||||
@ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private Long pushBy;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty("所属组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("所属组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private Long createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private Long updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("删除标记:1-正常,0-删除")
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.mhd.oms.domain.erpEnterpriseUnit.entity;
|
||||
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "企业单位")
|
||||
public class ErpEnterpriseUnit {
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "ERP单位编码")
|
||||
private String erpCode;
|
||||
|
||||
@ApiModelProperty(value = "ERP单位名称")
|
||||
private String erpName;
|
||||
|
||||
@ApiModelProperty(value = "推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty(value = "推送人")
|
||||
private String pushBy;
|
||||
|
||||
@ApiModelProperty(value = "推送人姓名")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty(value = "所属组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty(value = "一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty(value = "所属组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Long createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private Long updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "删除标记:1-正常,0-删除")
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.mhd.oms.domain.erpEnterpriseUnit.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.entity.ErpEnterpriseUnit;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.repository.po.ErpEnterpriseUnitPO;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.repository.todo.ErpEnterpriseUnitDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface ErpEnterpriseUnitMapper extends BaseMapper<ErpEnterpriseUnit> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param erpEnterpriseUnitDO
|
||||
* @return
|
||||
*/
|
||||
List<ErpEnterpriseUnitPO> queryList(@Param("erpEnterpriseUnitDO")ErpEnterpriseUnitDO erpEnterpriseUnitDO);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
int deleteByIds(@Param("idList") List<Long> idList);
|
||||
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.mhd.oms.domain.erpEnterpriseUnit.repository.po;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "企业单位PO")
|
||||
public class ErpEnterpriseUnitPO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "ERP单位编码")
|
||||
private String erpCode;
|
||||
|
||||
@ApiModelProperty(value = "ERP单位名称")
|
||||
private String erpName;
|
||||
|
||||
@ApiModelProperty(value = "推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty(value = "推送人")
|
||||
private Long pushBy;
|
||||
|
||||
@ApiModelProperty(value = "推送人")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty(value = "所属组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty(value = "一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty(value = "所属组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Long createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private Long updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "删除标记:1-正常,0-删除")
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.mhd.oms.domain.erpEnterpriseUnit.repository.todo;
|
||||
|
||||
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ErpEnterpriseUnitDO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "ERP单位编码")
|
||||
private String erpCode;
|
||||
|
||||
@ApiModelProperty(value = "ERP单位名称")
|
||||
private String erpName;
|
||||
|
||||
@ApiModelProperty(value = "推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@ApiModelProperty(value = "推送时间")
|
||||
private String pushTime;
|
||||
|
||||
@ApiModelProperty(value = "推送时间起")
|
||||
private String pushTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "推送时间止")
|
||||
private String pushTimeTo;
|
||||
|
||||
@ApiModelProperty(value = "推送人")
|
||||
private String pushBy;
|
||||
|
||||
@ApiModelProperty(value = "所属组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty(value = "所属组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间起")
|
||||
private String createTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "创建时间止")
|
||||
private String createTimeTo;
|
||||
|
||||
@ApiModelProperty(value = "页码")
|
||||
private Integer pageNum = 1;
|
||||
|
||||
@ApiModelProperty(value = "每页数量")
|
||||
private Integer pageSize = 10;
|
||||
|
||||
@ApiModelProperty(value = "每页数量")
|
||||
private Long TopOrganizationId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.mhd.oms.domain.gwLog.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("gw_log")
|
||||
public class GwLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("日志id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long logId;
|
||||
|
||||
@ApiModelProperty("类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("业务ID")
|
||||
private Long businessId;
|
||||
|
||||
@ApiModelProperty("请求报文")
|
||||
private String requestBody;
|
||||
|
||||
@ApiModelProperty("响应报文")
|
||||
private String responseBody;
|
||||
|
||||
@ApiModelProperty("状态(1-初始,2-成功,3-失败)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("错误信息")
|
||||
private String errorMsg;
|
||||
|
||||
@ApiModelProperty("推送时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date sendTime;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private Long createBy;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("删除标记:1-正常,0-删除")
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mhd.oms.domain.gwLog.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.po.GwLogPO;
|
||||
import com.mhd.oms.interfaces.dto.gwLog.GwLogDTO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface GwLogMapper extends BaseMapper<GwLog> {
|
||||
/**
|
||||
*
|
||||
* @param gwLogDTO
|
||||
* @return
|
||||
*/
|
||||
List<GwLogPO> queryList(GwLogDTO gwLogDTO);
|
||||
|
||||
@Select("select * from gw_log where business_id = #{businessId} and type = #{type} order by create_time desc")
|
||||
List<GwLogPO> selectByTypeAndId(@RequestBody GwLog gwLog);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.mhd.oms.domain.gwLog.repository.po;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class GwLogPO {
|
||||
|
||||
@ApiModelProperty("日志id")
|
||||
private Long logId;
|
||||
|
||||
@ApiModelProperty("类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("业务ID")
|
||||
private String businessId;
|
||||
|
||||
@ApiModelProperty("请求报文")
|
||||
private String requestBody;
|
||||
|
||||
@ApiModelProperty("响应报文")
|
||||
private String responseBody;
|
||||
|
||||
@ApiModelProperty("状态(1-初始,2-成功,3-失败)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("错误信息")
|
||||
private String errorMsg;
|
||||
|
||||
@ApiModelProperty("推送时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date sendTime;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private Long createBy;
|
||||
|
||||
@ApiModelProperty("创建人姓名")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("删除标记:1-正常,0-删除")
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
+7
-3
@@ -504,9 +504,6 @@ public class ReservationOrder {
|
||||
@ApiModelProperty(value = "订单结算状态:1未出账、2已出账、3部分结算、4已结算")
|
||||
private Integer settlementStatus;
|
||||
|
||||
@ApiModelProperty(value = "订单类型:0-预约单,1-业务单")
|
||||
private Integer orderType;
|
||||
|
||||
@ApiModelProperty(value = "订单运费结算时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@@ -701,9 +698,16 @@ public class ReservationOrder {
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
private String businessOrderNumber;
|
||||
@ApiModelProperty("订单状态(0.待确认,1.待提货,2.待补充,3.运输中,4.已完成,5.已取消)")
|
||||
private Integer orderType;
|
||||
|
||||
@ApiModelProperty("起运时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date departureTime;
|
||||
|
||||
@ApiModelProperty("业务主管")
|
||||
private String salesManager;
|
||||
@ApiModelProperty("审核意见")
|
||||
private String reviewOpinion;
|
||||
}
|
||||
|
||||
+20
-2
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO;
|
||||
import com.mhd.oms.domain.reservationOrder.entity.ReservationOrder;
|
||||
import com.mhd.oms.domain.reservationOrder.repository.po.ReservationOrderPO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO;
|
||||
import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderAddDTO;
|
||||
import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderDTO;
|
||||
import com.mhd.common.core.utils.sms.Result;
|
||||
@@ -16,11 +17,18 @@ import java.security.spec.InvalidKeySpecException;
|
||||
import com.mhd.oms.interfaces.facade.resevationOrder.BatchConfirmResult;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IOmsAddressMultiService {
|
||||
|
||||
void save(OmsOrderAddDTO tmsOrderAddDTO) throws InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException, SignatureException;
|
||||
|
||||
/**
|
||||
* 更新预约单
|
||||
* @param tmsOrderAddDTO 预约单信息
|
||||
*/
|
||||
void update(OmsOrderAddDTO tmsOrderAddDTO) throws InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException, SignatureException;
|
||||
|
||||
List<ReservationOrderPO> queryList(OmsOrderDTO omsOrderDTO);
|
||||
|
||||
/**
|
||||
@@ -28,14 +36,24 @@ public interface IOmsAddressMultiService {
|
||||
* @param goodsNumber 预约单号
|
||||
* @return 业务单信息
|
||||
*/
|
||||
BusinessDocumentOrderPO confirmReservationOrder(String goodsNumber);
|
||||
Boolean confirmReservationOrder(String goodsNumber);
|
||||
|
||||
/**
|
||||
* 批量确认预约单,生成业务单
|
||||
* @param goodsNumbers 预约单号列表
|
||||
* @return 批量处理结果
|
||||
*/
|
||||
Result<?> batchConfirmReservationOrder(List<String> goodsNumbers);
|
||||
Result<?> batchConfirmReservationOrder(BusinessAuditDTO businessAuditDTO);
|
||||
|
||||
Result<?> batchRejectReservationOrder(List<String> goodsNumbers);
|
||||
|
||||
/**
|
||||
* 根据订单状态(orderType)统计各状态的数量
|
||||
* @return Map<Integer, Long> key为orderType值,value为对应数量
|
||||
*/
|
||||
Map<Integer, Long> countByOrderType();
|
||||
|
||||
Integer cancelReserve(List<String> goodsNumbers);
|
||||
|
||||
OmsOrderDTO getResevationOrderInfo(String goodsNumber);
|
||||
}
|
||||
|
||||
+6
-1
@@ -723,7 +723,7 @@ public class ReservationOrderPO {
|
||||
private String executor;
|
||||
|
||||
@ApiModelProperty("业务单id")
|
||||
private Long businesssOrderId ;
|
||||
private Long businessOrderId ;
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
private String businessOrderNumber;
|
||||
@@ -735,4 +735,9 @@ public class ReservationOrderPO {
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date departureTime;
|
||||
|
||||
@ApiModelProperty("业务主管")
|
||||
private String salesManager;
|
||||
@ApiModelProperty("审核意见")
|
||||
private String reviewOpinion;
|
||||
}
|
||||
|
||||
+473
-104
@@ -12,6 +12,7 @@ import com.mhd.common.core.utils.sms.Result;
|
||||
import com.mhd.oms.application.service.businessDocumentOrder.BusinessDocumentOrderApplicationService;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.facade.IBusinessDocumentOrderService;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO;
|
||||
import com.mhd.oms.domain.businessDocumentCargoMulti.entity.BusinessDocumentCargoMulti;
|
||||
import com.mhd.oms.domain.businessDocumentCargoMulti.repository.mapper.BusinessDocumentCargoMultiMapper;
|
||||
@@ -30,6 +31,9 @@ import com.mhd.oms.domain.reservationOrder.repository.po.ReservationOrderPO;
|
||||
import com.mhd.oms.enums.*;
|
||||
import com.mhd.oms.infrastructure.feign.ThirdPartyServiceFeign;
|
||||
//import com.mhd.oms.infrastructure.feign.TransportServiceFeign;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessDocumentAddressMultiDTO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentCargoMulti.BusinessDocumentCargoMultiDTO;
|
||||
import com.mhd.oms.interfaces.dto.resevationOrder.*;
|
||||
import com.mhd.oms.interfaces.facade.resevationOrder.BatchConfirmResult;
|
||||
import com.mhd.oms.util.DictDataUtils;
|
||||
@@ -41,12 +45,16 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.core.domain.po.UserShipperPo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
@@ -114,6 +122,9 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
@Autowired
|
||||
private IBusinessDocumentOrderService businessDocumentOrderService;
|
||||
|
||||
@Resource
|
||||
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
||||
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -424,10 +435,10 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
resevationOrder.setLoadingPhone(firstAddress.getContactPhone());
|
||||
resevationOrder.setLoadingDate(firstAddress.getLayDate());
|
||||
|
||||
resevationOrder.setUnloadAreaId(lastAddress.getAreaCode());
|
||||
resevationOrder.setUnloadName(lastAddress.getAreaCode());
|
||||
resevationOrder.setUnloadAddress(lastAddress.getAddress());
|
||||
String unarea = lastAddress.getAreaCode() + lastAddress.getAddress();
|
||||
resevationOrder.setUnloadAreaId(lastAddress.getAreaCode());
|
||||
resevationOrder.setUnloadName(lastAddress.getAreaCode());
|
||||
resevationOrder.setUnloadAddress(lastAddress.getAddress());
|
||||
String unarea = lastAddress.getAreaCode() + lastAddress.getAddress();
|
||||
/*String ungeo = amapService.geo(unarea);
|
||||
String unloadingLatitude = ungeo.substring(ungeo.indexOf(",") + 1);
|
||||
String unloadingLongitude = ungeo.substring(0,ungeo.indexOf(","));
|
||||
@@ -524,11 +535,11 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
resevationOrder.setTransportationModeId(1);
|
||||
}
|
||||
}
|
||||
//设置是否自动审核
|
||||
//自动审核用户信息(0否1是)
|
||||
//设置是否自动审核
|
||||
//自动审核用户信息(0否1是)
|
||||
// SysConfigSwitch configSwitch = sysConfigSwitchService.queryBySysOrgCode();
|
||||
//查询平台业务员
|
||||
// 从UserCenter服务获取平台业务员信息
|
||||
//查询平台业务员
|
||||
// 从UserCenter服务获取平台业务员信息
|
||||
// UserDTO userDTO = new UserDTO();
|
||||
// userDTO.setUserRole("platAuther");
|
||||
// AjaxResult platAutherResult = AjaxResult.success(userServiceFeign.getUserByTopOrganizationUserAccount(userDTO, "oms"));
|
||||
@@ -867,12 +878,272 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
// tmsBidingDocumentLine.setServiceRate(tmsOrderAddDTO.getServiceRate());
|
||||
// tmsBidingDocumentLine.setSingleVehicleWeight(tmsOrderAddDTO.getSingleVehicleWeight());
|
||||
|
||||
// tmsBidingDocumentLineMapper.insert(tmsBidingDocumentLine);
|
||||
// tmsBidingDocumentLineMapper.insert(tmsBidingDocumentLine);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void update(OmsOrderAddDTO tmsOrderAddDTO) throws InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException, SignatureException {
|
||||
if (StringUtils.isBlank(tmsOrderAddDTO.getGoodsQuantity())) {
|
||||
tmsOrderAddDTO.setGoodsQuantity("0");
|
||||
}
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
//获取登录人
|
||||
// 从UserCenter服务获取用户信息
|
||||
AjaxResult userInfoResult = userServiceFeign.getInfo(Long.valueOf(loginUser.getUserid()));
|
||||
if (!userInfoResult.get("code").toString().equals("200")) {
|
||||
throw new ServiceException("获取用户信息失败");
|
||||
}
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
UserPo userPo = objectMapper.convertValue(userInfoResult.get("data"), UserPo.class);
|
||||
|
||||
// 从UserCenter服务获取货主信息
|
||||
AjaxResult shipperInfoResult = userServiceFeign.getShipperByUserId(Long.valueOf(loginUser.getUserid()));
|
||||
if (!shipperInfoResult.get("code").toString().equals("200")) {
|
||||
throw new ServiceException("获取货主信息失败");
|
||||
}
|
||||
|
||||
//处理费用默认值
|
||||
handFee(tmsOrderAddDTO);
|
||||
|
||||
//组织赋值
|
||||
Long organizationId = tmsOrderAddDTO.getOrganizationId();
|
||||
if (ObjectUtil.isNotEmpty(organizationId)) {
|
||||
tmsOrderAddDTO.setOrgId(String.valueOf(organizationId));
|
||||
tmsOrderAddDTO.setOrgName(tmsOrderAddDTO.getOrganizationName());
|
||||
}
|
||||
|
||||
// 获取一份副本等一会需要存储到数据库
|
||||
String swzlUserId = String.valueOf(loginUser.getUserid());
|
||||
|
||||
// 从UserCenter服务获取当前登录用户的货主信息
|
||||
AjaxResult shipperResult = userServiceFeign.getShipperByUserId(Long.valueOf(loginUser.getUserid()));
|
||||
if (!shipperResult.get("code").toString().equals("200")) {
|
||||
throw new ServiceException("您非货主角色或账号已被删除!");
|
||||
}
|
||||
UserShipperPo userShipperPoInfo = objectMapper.convertValue(shipperResult.get("data"), UserShipperPo.class);
|
||||
|
||||
if (userShipperPoInfo == null) {
|
||||
throw new ServiceException("您非货主角色或账号已被删除!");
|
||||
}
|
||||
|
||||
String orderRemark = tmsOrderAddDTO.getOrderRemark();
|
||||
tmsOrderAddDTO.setRemarks(orderRemark);
|
||||
|
||||
tmsOrderAddDTO.setAppointShipperId(String.valueOf(userShipperPoInfo.getShipperId()));
|
||||
|
||||
// 分类处理货物列表
|
||||
List<OmsCargoInfoDTO> allCargoList = tmsOrderAddDTO.getCargoInfoList();
|
||||
|
||||
//获取货主月结标识,
|
||||
int receivableType;
|
||||
int autoAuditOrder;
|
||||
if (userShipperPoInfo.getShipperType() == 2) {
|
||||
// 从UserCenter服务获取企业货主信息
|
||||
AjaxResult companyShipperResult = userServiceFeign.getShipperByUserId(userShipperPoInfo.getUserId());
|
||||
if (!companyShipperResult.get("code").toString().equals("200")) {
|
||||
throw new ServiceException("获取企业货主信息失败");
|
||||
}
|
||||
UserShipperPo companyUserShipperPo = objectMapper.convertValue(companyShipperResult.get("data"), UserShipperPo.class);
|
||||
receivableType = companyUserShipperPo.getMonthlySettlementFlag();
|
||||
autoAuditOrder = companyUserShipperPo.getIsAutoAuditOrder();
|
||||
} else {
|
||||
receivableType = userShipperPoInfo.getMonthlySettlementFlag();
|
||||
autoAuditOrder = userShipperPoInfo.getIsAutoAuditOrder();
|
||||
}
|
||||
tmsOrderAddDTO.setReceivableType(receivableType);
|
||||
|
||||
//非企业员工判断个人信息审核状态x
|
||||
if (userShipperPoInfo.getShipperType() != 2 && userShipperPoInfo.getShipperFill() != 3) { // 假设3代表审核通过
|
||||
throw new ServiceException("未提交个人信息认证或认证未通过,请先认证!");
|
||||
}
|
||||
//企业员工判断企业货主审核状态
|
||||
if (userShipperPoInfo.getShipperType() == 2) {
|
||||
// 从UserCenter服务获取企业用户信息
|
||||
AjaxResult companyUserResult = userServiceFeign.getInfo(userShipperPoInfo.getUserId());
|
||||
if (!companyUserResult.get("code").toString().equals("200")) {
|
||||
throw new ServiceException("获取企业用户信息失败");
|
||||
}
|
||||
userPo = objectMapper.convertValue(companyUserResult.get("data"), UserPo.class);
|
||||
}
|
||||
|
||||
//企业员工判断企业货主审核状态
|
||||
if (userShipperPoInfo.getShipperType() == 2) {
|
||||
// 从UserCenter服务获取企业货主信息
|
||||
AjaxResult companyShipperResult = userServiceFeign.getShipperByUserId(userShipperPoInfo.getUserId());
|
||||
if (!companyShipperResult.get("code").toString().equals("200")) {
|
||||
throw new ServiceException("获取企业货主信息失败");
|
||||
}
|
||||
UserShipperPo companyUserShipperPo = objectMapper.convertValue(companyShipperResult.get("data"), UserShipperPo.class);
|
||||
if (companyUserShipperPo.getShipperFill() != 3) { // 假设3代表审核通过
|
||||
throw new ServiceException("未提交个人信息认证或认证未通过,请先认证!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新货源单信息
|
||||
*/
|
||||
ReservationOrder resevationOrder = new ReservationOrder();
|
||||
BeanUtils.copyProperties(tmsOrderAddDTO, resevationOrder);
|
||||
String id = tmsOrderAddDTO.getId();
|
||||
resevationOrder.setId(Long.valueOf(id));
|
||||
|
||||
// 设置更新时间戳和用户信息
|
||||
resevationOrder.setUpdateTime(new Date());
|
||||
resevationOrder.setUpdateBy(loginUser.getWlhyLoginUser().getRealname());
|
||||
// resevationOrder.setUpdateByName(userPo.getUserName());
|
||||
|
||||
// 检查ID是否为空
|
||||
if (resevationOrder.getId() == null || resevationOrder.getId() <= 0) {
|
||||
throw new ServiceException("预约单ID不能为空,无法执行更新操作");
|
||||
}
|
||||
List<OmsAddressMultiDTO> loadingAddressList = tmsOrderAddDTO.getLoadingAddressList();//装货地信息集合
|
||||
List<OmsAddressMultiDTO> unloadAddressList = tmsOrderAddDTO.getUnloadAddressList();//卸货地信息集合
|
||||
|
||||
/*if (CollUtil.isEmpty(loadingAddressList)) {
|
||||
throw new ServiceException("请传入装货地址!");
|
||||
}
|
||||
|
||||
if (CollUtil.isEmpty(unloadAddressList)) {
|
||||
throw new ServiceException("请传入卸货地址!");
|
||||
}*/
|
||||
|
||||
String loadCityCounty = "", unloadCityCounty = "";
|
||||
//当是短驳的时候不走这个逻辑
|
||||
/*for (int i = 0; i < loadingAddressList.size(); i++) {
|
||||
//根据行政区划代码获取省市县名称
|
||||
String areaName= sysComboService.getLoadOrUnloadName(loadingAddressList.get(i).getAreaCode());
|
||||
loadingAddressList.get(i).setAreaName(areaName);
|
||||
// 简称
|
||||
String shortName= sysComboService.getCityCountyName(loadingAddressList.get(i).getAreaCode());
|
||||
loadingAddressList.get(i).setShortName(shortName);
|
||||
//获取装卸货地经纬度
|
||||
String[] lng2Lat = setLngAndLat(loadingAddressList.get(i).getAreaCode(), loadingAddressList.get(i).getLongitude(),
|
||||
loadingAddressList.get(i).getLatitude(), loadingAddressList.get(i).getAddress());
|
||||
if (null != lng2Lat) {
|
||||
loadingAddressList.get(i).setLongitude(lng2Lat[0]);
|
||||
loadingAddressList.get(i).setLatitude(lng2Lat[1]);
|
||||
}
|
||||
//获取装货时间
|
||||
SysDictData sysDictData = getLayTime(loadingAddressList.get(i).getLayTimeId());
|
||||
if (sysDictData != null) {
|
||||
loadingAddressList.get(i).setLayTimeId(sysDictData.getDictValue());
|
||||
loadingAddressList.get(i).setLayTime(sysDictData.getDictLabel());
|
||||
}
|
||||
|
||||
loadingAddressList.get(i).setSort(i);
|
||||
}
|
||||
for (int i = 0; i < unloadAddressList.size(); i++) {
|
||||
//根据行政区划代码获取省市县名称
|
||||
//String areaName= sysComboService.getLoadOrUnloadName(unloadAddressList.get(i).getAreaCode());
|
||||
//unloadAddressList.get(i).setAreaName(areaName);
|
||||
// 简称
|
||||
//String shortName= sysComboService.getCityCountyName(unloadAddressList.get(i).getAreaCode());
|
||||
//unloadAddressList.get(i).setShortName(shortName);
|
||||
//获取装卸货地经纬度
|
||||
String[] lng2Lat = setLngAndLat(unloadAddressList.get(i).getAreaCode(), unloadAddressList.get(i).getLongitude(),
|
||||
unloadAddressList.get(i).getLatitude(), unloadAddressList.get(i).getAddress());
|
||||
if (null != lng2Lat) {
|
||||
unloadAddressList.get(i).setLongitude(lng2Lat[0]);
|
||||
unloadAddressList.get(i).setLatitude(lng2Lat[1]);
|
||||
}
|
||||
//获取装货时间
|
||||
SysDictData sysDictData = getLayTime(unloadAddressList.get(i).getLayTimeId());
|
||||
if (sysDictData != null) {
|
||||
unloadAddressList.get(i).setLayTimeId(sysDictData.getDictValue());
|
||||
unloadAddressList.get(i).setLayTime(sysDictData.getDictLabel());
|
||||
}
|
||||
|
||||
|
||||
unloadAddressList.get(i).setSort(i);
|
||||
// }
|
||||
//多装多卸获取第一个装货地址和最后一个卸货地址 获取省市县简称
|
||||
loadCityCounty = sysComboService.getCityCountyName(loadingAddressList.get(0).getAreaCode());
|
||||
unloadCityCounty = sysComboService.getCityCountyName(unloadAddressList.get(unloadAddressList.size() - 1).getAreaCode());
|
||||
resevationOrder.setLineTitleLeft(loadCityCounty);
|
||||
resevationOrder.setLineTitleRight(unloadCityCounty);
|
||||
}*/
|
||||
//获取第一条装货地址和获取最后一条卸货地址
|
||||
OmsAddressMultiDTO firstAddress = loadingAddressList.get(0);
|
||||
OmsAddressMultiDTO lastAddress = unloadAddressList.get(unloadAddressList.size() - 1);
|
||||
resevationOrder.setLoadingAreaId(firstAddress.getAreaCode());
|
||||
resevationOrder.setLoadingName(firstAddress.getAreaCode());
|
||||
resevationOrder.setLoadingAddress(firstAddress.getAddress());
|
||||
String area = firstAddress.getAreaCode() + firstAddress.getAddress();
|
||||
/*String geo = amapService.geo(area);
|
||||
String loadingLatitude = geo.substring(geo.indexOf(",") + 1);
|
||||
String loadingLongitude = geo.substring(0,geo.indexOf(","));
|
||||
resevationOrder.setLoadingLongitude(loadingLongitude);
|
||||
resevationOrder.setLoadingLatitude(loadingLatitude);
|
||||
firstAddress.setLatitude(loadingLatitude);
|
||||
firstAddress.setLongitude(loadingLongitude);*/
|
||||
resevationOrder.setLineTitleLeft(firstAddress.getAreaCode());
|
||||
resevationOrder.setLineTitleRight(lastAddress.getAreaCode());
|
||||
resevationOrder.setFreighterName(firstAddress.getContactName());
|
||||
resevationOrder.setLoadingPhone(firstAddress.getContactPhone());
|
||||
resevationOrder.setLoadingDate(firstAddress.getLayDate());
|
||||
|
||||
resevationOrder.setUnloadAreaId(lastAddress.getAreaCode());
|
||||
resevationOrder.setUnloadName(lastAddress.getAreaCode());
|
||||
resevationOrder.setUnloadAddress(lastAddress.getAddress());
|
||||
String unarea = lastAddress.getAreaCode() + lastAddress.getAddress();
|
||||
/*String ungeo = amapService.geo(unarea);
|
||||
String unloadingLatitude = ungeo.substring(ungeo.indexOf(",") + 1);
|
||||
String unloadingLongitude = ungeo.substring(0,ungeo.indexOf(","));
|
||||
lastAddress.setLatitude(unloadingLatitude);
|
||||
lastAddress.setLongitude(unloadingLongitude);
|
||||
resevationOrder.setUnloadLongitude(unloadingLongitude);
|
||||
resevationOrder.setUnloadLatitude(unloadingLatitude);*/
|
||||
resevationOrder.setDischargerName(lastAddress.getContactName());
|
||||
resevationOrder.setUnloadPhone(lastAddress.getContactPhone());
|
||||
resevationOrder.setUnloadingData(lastAddress.getLayDate());
|
||||
// 执行更新操作
|
||||
int result = resevationOrderMapper.updateById(resevationOrder);
|
||||
if (result == 0) {
|
||||
throw new ServiceException("更新失败:未找到对应的预约单记录");
|
||||
}
|
||||
|
||||
// 更新费用科目信息
|
||||
List<OmsOrderAccount> tmsOrderAccountList = tmsOrderAddDTO.getTmsOrderAccountList();
|
||||
if (ObjectUtil.isNotNull(tmsOrderAccountList) && tmsOrderAccountList.size() > 0) {
|
||||
// 先删除旧的费用科目信息
|
||||
tmsOrderAccountMapper.delete(new LambdaQueryWrapper<OmsOrderAccount>().eq(OmsOrderAccount::getOrderId, String.valueOf(resevationOrder.getId())));
|
||||
|
||||
// 插入新的费用科目信息
|
||||
for (OmsOrderAccount tmsOrderAccount : tmsOrderAccountList) {
|
||||
tmsOrderAccount.setIsDelete(0);
|
||||
tmsOrderAccount.setOrderId(String.valueOf(resevationOrder.getId()));
|
||||
tmsOrderAccount.setCreateBy(String.valueOf(userPo.getUserId()));
|
||||
tmsOrderAccount.setCreateTime(new Date());
|
||||
|
||||
// 设置组织信息
|
||||
if (tmsOrderAddDTO.getOrganizationId() != null) {
|
||||
tmsOrderAccount.setOrganizationId(tmsOrderAddDTO.getOrganizationId());
|
||||
}
|
||||
if (tmsOrderAddDTO.getOrganizationName() != null) {
|
||||
tmsOrderAccount.setOrganizationName(tmsOrderAddDTO.getOrganizationName());
|
||||
}
|
||||
if (tmsOrderAddDTO.getTopOrganizationId() != null) {
|
||||
tmsOrderAccount.setTopOrganizationId(tmsOrderAddDTO.getTopOrganizationId());
|
||||
}
|
||||
|
||||
tmsOrderAccountMapper.insert(tmsOrderAccount);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新货物信息及地址信息
|
||||
saveAddress2CargoInfo(String.valueOf(resevationOrder.getId()), allCargoList, tmsOrderAddDTO.getLoadingAddressList(), tmsOrderAddDTO.getUnloadAddressList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<ReservationOrderPO> queryList(OmsOrderDTO omsOrderDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
@@ -882,6 +1153,10 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
omsOrderDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
}
|
||||
Long organizationId = loginUser.getUserPo().getOrganizationId();
|
||||
if (organizationId !=2827L){
|
||||
omsOrderDTO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
}
|
||||
List<ReservationOrderPO> reservationOrderPOS = reservationOrderDomainService.queryList(omsOrderDTO);
|
||||
for (ReservationOrderPO reservationOrderPO : reservationOrderPOS){
|
||||
List<ReservationCargoInfo> reservationCargoInfoList = reservationCargoInfoMapper.selectList(new LambdaQueryWrapper<ReservationCargoInfo>().eq(ReservationCargoInfo::getOrderId, reservationOrderPO.getId()));
|
||||
@@ -1078,7 +1353,7 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
// }
|
||||
|
||||
@Override
|
||||
public BusinessDocumentOrderPO confirmReservationOrder(String goodsNumber) {
|
||||
public Boolean confirmReservationOrder(String goodsNumber) {
|
||||
|
||||
LambdaQueryWrapper<ReservationOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ReservationOrder::getGoodsNumber, goodsNumber);
|
||||
@@ -1102,71 +1377,27 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
|
||||
BusinessDocumentOrderDO businessDocumentOrderDO = new BusinessDocumentOrderDO();
|
||||
|
||||
// 基本信息映射
|
||||
businessDocumentOrderDO.setGoodsNumber(OrderSequence.getOrderCodeByDate(new Date())); // 生成业务单号
|
||||
businessDocumentOrderDO.setGoodsNumber(reservationOrder.getGoodsNumber()); // 生成业务单号
|
||||
businessDocumentOrderDO.setOrderStatus(0L); // 业务单状态:0-待审核
|
||||
businessDocumentOrderDO.setReviewStatus(0L); // 审核状态:0-未审核
|
||||
businessDocumentOrderDO.setExecuteStatus(0L); // 执行状态:0-无状态
|
||||
businessDocumentOrderDO.setExecuteStatus(0L);
|
||||
|
||||
|
||||
businessDocumentOrderDO.setReservationOrderId(reservationOrder.getId());
|
||||
businessDocumentOrderDO.setReservationOrderNumber(reservationOrder.getGoodsNumber());
|
||||
BeanUtils.copyProperties(reservationOrder, businessDocumentOrderDO);
|
||||
|
||||
businessDocumentOrderDO.setGoodsName(reservationOrder.getGoodsName());
|
||||
businessDocumentOrderDO.setGoodsTypeId(reservationOrder.getGoodsTypeId());
|
||||
businessDocumentOrderDO.setWeightMin(reservationOrder.getWeightMin());
|
||||
businessDocumentOrderDO.setWeightMax(reservationOrder.getWeightMax());
|
||||
businessDocumentOrderDO.setGoodsUntis(reservationOrder.getGoodsUntis());
|
||||
businessDocumentOrderDO.setGoodsUntisId(reservationOrder.getGoodsUntisId());
|
||||
businessDocumentOrderDO.setLoadingName(reservationOrder.getLoadingName());
|
||||
businessDocumentOrderDO.setLoadingAreaId(reservationOrder.getLoadingAreaId());
|
||||
businessDocumentOrderDO.setLoadingAddress(reservationOrder.getLoadingAddress());
|
||||
businessDocumentOrderDO.setLoadingLongitude(reservationOrder.getLoadingLongitude());
|
||||
businessDocumentOrderDO.setLoadingLatitude(reservationOrder.getLoadingLatitude());
|
||||
businessDocumentOrderDO.setLoadingPhone(reservationOrder.getLoadingPhone());
|
||||
businessDocumentOrderDO.setLoadingDate(reservationOrder.getLoadingDate());
|
||||
|
||||
businessDocumentOrderDO.setUnloadName(reservationOrder.getUnloadName());
|
||||
businessDocumentOrderDO.setUnloadAreaId(reservationOrder.getUnloadAreaId());
|
||||
businessDocumentOrderDO.setUnloadAddress(reservationOrder.getUnloadAddress());
|
||||
businessDocumentOrderDO.setUnloadLongitude(reservationOrder.getUnloadLongitude());
|
||||
businessDocumentOrderDO.setUnloadLatitude(reservationOrder.getUnloadLatitude());
|
||||
businessDocumentOrderDO.setUnloadPhone(reservationOrder.getUnloadPhone());
|
||||
businessDocumentOrderDO.setUnloadingData(reservationOrder.getUnloadingData());
|
||||
businessDocumentOrderDO.setFreighterName(reservationOrder.getFreighterName());
|
||||
businessDocumentOrderDO.setDischargerName(reservationOrder.getDischargerName());
|
||||
businessDocumentOrderDO.setRemarks(reservationOrder.getRemarks());
|
||||
businessDocumentOrderDO.setTransportationModeId(reservationOrder.getTransportationModeId() != null ?
|
||||
reservationOrder.getTransportationModeId().longValue() : null);
|
||||
businessDocumentOrderDO.setTransportationName(reservationOrder.getTransportationName());
|
||||
businessDocumentOrderDO.setCarType(reservationOrder.getCarType());
|
||||
businessDocumentOrderDO.setCarTypeName(reservationOrder.getCarTypeName());
|
||||
businessDocumentOrderDO.setServiceRequireId(reservationOrder.getServiceRequireId());
|
||||
businessDocumentOrderDO.setServiceRequire(reservationOrder.getServiceRequire());
|
||||
businessDocumentOrderDO.setAppointShipperId(reservationOrder.getAppointShipperId());
|
||||
businessDocumentOrderDO.setAppointShipper(reservationOrder.getAppointShipper());
|
||||
businessDocumentOrderDO.setReceivableType(reservationOrder.getReceivableType() != null ?
|
||||
reservationOrder.getReceivableType().longValue() : 2L);
|
||||
|
||||
businessDocumentOrderDO.setOrderShippingType(reservationOrder.getOrderShippingType() != null ?
|
||||
reservationOrder.getOrderShippingType().longValue() : 1L);
|
||||
|
||||
|
||||
businessDocumentOrderDO.setOrganizationId(reservationOrder.getOrganizationId());
|
||||
businessDocumentOrderDO.setOrganizationName(reservationOrder.getOrganizationName());
|
||||
businessDocumentOrderDO.setTopOrganizationId(reservationOrder.getTopOrganizationId());
|
||||
businessDocumentOrderDO.setOrgId(reservationOrder.getOrgId());
|
||||
businessDocumentOrderDO.setOrgName(reservationOrder.getOrgName());
|
||||
|
||||
|
||||
businessDocumentOrderDO.setRealCreateBy(String.valueOf(loginUser.getUserid()));
|
||||
businessDocumentOrderDO.setRealCreateName(loginUser.getUsername());
|
||||
businessDocumentOrderDO.setCreateBy(loginUser.getUserid());
|
||||
businessDocumentOrderDO.setCreateByName(loginUser.getUsername());
|
||||
|
||||
businessDocumentOrderDO.setCreateTime(new Date());
|
||||
businessDocumentOrderDO.setUpdateTime(new Date());
|
||||
businessDocumentOrderDO.setDocumentDate(new Date());
|
||||
businessDocumentOrderDO.setPayerType(1L);
|
||||
businessDocumentOrderDO.setLayDate(reservationOrder.getDepartureTime());
|
||||
|
||||
if (businessDocumentOrderDO.getOrderShippingType() == null) {
|
||||
businessDocumentOrderDO.setOrderShippingType(1L); // 默认设置为1
|
||||
@@ -1175,53 +1406,103 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
businessDocumentOrderDO.setInfoFeePayeeType(0L); // 默认设置为0
|
||||
}
|
||||
|
||||
BusinessDocumentOrder businessDocumentOrder = new BusinessDocumentOrder();
|
||||
BeanUtils.copyProperties(businessDocumentOrderDO, businessDocumentOrder);
|
||||
businessDocumentOrder.setId(null); // 确保是新记录
|
||||
businessDocumentOrder.setCreateBy(Long.valueOf(loginUser.getUserid()));
|
||||
businessDocumentOrder.setCreateByName(loginUser.getUsername());
|
||||
businessDocumentOrder.setCreateTime(new Date());
|
||||
businessDocumentOrder.setUpdateTime(new Date());
|
||||
businessDocumentOrder.setDelFlag(1);
|
||||
|
||||
boolean insertResult = businessDocumentOrderService.save(businessDocumentOrder);
|
||||
// 组装货物信息 - 从 RESERVATION_CARGO_INFO 表查询
|
||||
List<BusinessDocumentCargoMultiDTO> businessDocumentCargoMultiList = new ArrayList<>();
|
||||
LambdaQueryWrapper<ReservationCargoInfo> cargoQueryWrapper = new LambdaQueryWrapper<>();
|
||||
cargoQueryWrapper.eq(ReservationCargoInfo::getOrderId, reservationOrder.getId());
|
||||
List<ReservationCargoInfo> reservationCargoList = reservationCargoInfoMapper.selectList(cargoQueryWrapper);
|
||||
if (reservationCargoList.size() > 0) {
|
||||
for (ReservationCargoInfo reservationCargo : reservationCargoList) {
|
||||
BusinessDocumentCargoMultiDTO cargoDTO = new BusinessDocumentCargoMultiDTO();
|
||||
cargoDTO.setCargoName(reservationCargo.getCargoName());
|
||||
cargoDTO.setCargoNum(reservationCargo.getCargoNum() != null ? reservationCargo.getCargoNum() : BigDecimal.ZERO);
|
||||
cargoDTO.setCargoWeight(reservationCargo.getCargoWeight() != null ? reservationCargo.getCargoWeight() : BigDecimal.ZERO);
|
||||
cargoDTO.setCargoUnitName(reservationCargo.getCargoUnitName());
|
||||
cargoDTO.setWeightUnit(reservationCargo.getCargoUnitName());
|
||||
cargoDTO.setGoodsTypeId(reservationCargo.getGoodsTypeId());
|
||||
cargoDTO.setGoodsType(reservationCargo.getGoodsType());
|
||||
cargoDTO.setGoodsNameId(reservationCargo.getGoodsNameId());
|
||||
cargoDTO.setGoodsName(reservationCargo.getGoodsName());
|
||||
cargoDTO.setMaterialContent(reservationCargo.getCargoContent());
|
||||
cargoDTO.setMachineCode(reservationCargo.getMachineCode());
|
||||
businessDocumentCargoMultiList.add(cargoDTO);
|
||||
}
|
||||
}
|
||||
businessDocumentOrderDO.setBusinessDocumentCargoMultiList(businessDocumentCargoMultiList);
|
||||
|
||||
// 组装装卸货地址信息 - 从 RESERVATION_ADDRESS_MULTI 表查询
|
||||
List<BusinessDocumentAddressMultiDTO> loadingAddressList = new ArrayList<>();
|
||||
List<BusinessDocumentAddressMultiDTO> unloadAddressList = new ArrayList<>();
|
||||
|
||||
|
||||
// 查询装货地址 (layType = 1)
|
||||
LambdaQueryWrapper<ReservationAddressMulti> loadingQueryWrapper = new LambdaQueryWrapper<>();
|
||||
loadingQueryWrapper.eq(ReservationAddressMulti::getOrderId, reservationOrder.getId())
|
||||
.eq(ReservationAddressMulti::getLayType, 1);
|
||||
List<ReservationAddressMulti> loadingAddressList1 = reservationAddressMultiMapper.selectList(loadingQueryWrapper);
|
||||
// @ApiModelProperty(value = "装货地址集合")
|
||||
// private List<BusinessDocumentAddressMultiDTO> loadingAddressList;
|
||||
// @ApiModelProperty(value = "卸货地址集合")
|
||||
// private List<BusinessDocumentAddressMultiDTO> unloadAddressList;
|
||||
if (loadingAddressList1.size() > 0) {
|
||||
for (ReservationAddressMulti address : loadingAddressList1) {
|
||||
BusinessDocumentAddressMultiDTO loadingAddress = new BusinessDocumentAddressMultiDTO();
|
||||
loadingAddress.setAreaCode(address.getAreaCode());
|
||||
loadingAddress.setAreaName(address.getAreaName());
|
||||
loadingAddress.setAddress(address.getAddress());
|
||||
loadingAddress.setLongitude(address.getLongitude());
|
||||
loadingAddress.setLatitude(address.getLatitude());
|
||||
loadingAddress.setContactName(address.getContactName());
|
||||
loadingAddress.setContactPhone(address.getContactPhone());
|
||||
loadingAddress.setLayDate(address.getLayDate());
|
||||
loadingAddress.setLayTimeId(address.getLayTimeId());
|
||||
loadingAddress.setLayType(Long.valueOf(address.getLayType()));
|
||||
// loadingAddress.setSort(Long.valueOf(address.getSort()));
|
||||
// loadingAddress.setShortName(address.getShortName());
|
||||
loadingAddressList.add(loadingAddress);
|
||||
}
|
||||
}
|
||||
|
||||
// 查询卸货地址 (layType = 2)
|
||||
LambdaQueryWrapper<ReservationAddressMulti> unloadQueryWrapper = new LambdaQueryWrapper<>();
|
||||
unloadQueryWrapper.eq(ReservationAddressMulti::getOrderId, reservationOrder.getId())
|
||||
.eq(ReservationAddressMulti::getLayType, 2);
|
||||
List<ReservationAddressMulti> unloadAddressList1 = reservationAddressMultiMapper.selectList(unloadQueryWrapper);
|
||||
if (unloadAddressList1.size() > 0) {
|
||||
for (ReservationAddressMulti address : unloadAddressList1) {
|
||||
BusinessDocumentAddressMultiDTO unloadAddress = new BusinessDocumentAddressMultiDTO();
|
||||
unloadAddress.setAreaCode(address.getAreaCode());
|
||||
unloadAddress.setAreaName(address.getAreaName());
|
||||
unloadAddress.setAddress(address.getAddress());
|
||||
unloadAddress.setLongitude(address.getLongitude());
|
||||
unloadAddress.setLatitude(address.getLatitude());
|
||||
unloadAddress.setContactName(address.getContactName());
|
||||
unloadAddress.setContactPhone(address.getContactPhone());
|
||||
unloadAddress.setLayDate(address.getLayDate());
|
||||
unloadAddress.setLayTimeId(address.getLayTimeId());
|
||||
unloadAddress.setLayType(Long.valueOf(address.getLayType()));
|
||||
unloadAddress.setShortName(address.getShortName());
|
||||
unloadAddressList.add(unloadAddress);
|
||||
}
|
||||
}
|
||||
|
||||
businessDocumentOrderDO.setLoadingAddressList(loadingAddressList);
|
||||
businessDocumentOrderDO.setUnloadAddressList(unloadAddressList);
|
||||
businessDocumentOrderDO.setOrderSource("0");
|
||||
|
||||
// 插入业务单
|
||||
Boolean insertResult = businessDocumentOrderApplicationService.insert(businessDocumentOrderDO);
|
||||
if (!insertResult) {
|
||||
throw new ServiceException("创建业务单失败");
|
||||
}
|
||||
|
||||
|
||||
LambdaQueryWrapper<BusinessDocumentOrder> orderQueryWrapper = new LambdaQueryWrapper<>();
|
||||
orderQueryWrapper.eq(BusinessDocumentOrder::getGoodsNumber, businessDocumentOrderDO.getGoodsNumber());
|
||||
BusinessDocumentOrder createdOrder = businessDocumentOrderService.getOne(orderQueryWrapper);
|
||||
if (createdOrder == null) {
|
||||
throw new ServiceException("创建业务单后查询失败");
|
||||
}
|
||||
|
||||
// 处理货物信息(从预约单获取)
|
||||
// handleCargoInfoFromReservation(createdOrder.getId(), reservationOrder.getId());
|
||||
|
||||
// 处理地址信息(从预约单获取)
|
||||
handleAddressInfoFromReservation(createdOrder.getId(), reservationOrder.getId());
|
||||
|
||||
// 更新预约单状态
|
||||
reservationOrder.setOrderType(1); // 设置为业务单类型
|
||||
reservationOrder.setBusinessOrderId(businessDocumentOrder.getId()); // 关联业务单ID
|
||||
reservationOrder.setBusinessOrderNumber(businessDocumentOrder.getGoodsNumber()); // 关联业务单号
|
||||
reservationOrder.setUpdateTime(new Date());
|
||||
reservationOrder.setUpdateBy(String.valueOf(loginUser.getUserid()));
|
||||
|
||||
int updateResult = resevationOrderMapper.updateById(reservationOrder);
|
||||
if (updateResult <= 0) {
|
||||
throw new ServiceException("更新预约单状态失败");
|
||||
}
|
||||
|
||||
|
||||
BusinessDocumentOrderPO businessDocumentOrderPO = new BusinessDocumentOrderPO();
|
||||
BeanUtils.copyProperties(businessDocumentOrder, businessDocumentOrderPO);
|
||||
|
||||
return businessDocumentOrderPO;
|
||||
BusinessDocumentOrder businessDocumentOrder = businessDocumentOrderMapper.selectOne(new LambdaQueryWrapper<BusinessDocumentOrder>().eq(BusinessDocumentOrder::getGoodsNumber, goodsNumber));
|
||||
reservationOrder.setBusinessOrderId(businessDocumentOrder.getId());
|
||||
reservationOrder.setBusinessOrderNumber(businessDocumentOrderDO.getGoodsNumber());
|
||||
reservationOrder.setOrderType(1);
|
||||
|
||||
resevationOrderMapper.updateById(reservationOrder);
|
||||
|
||||
return insertResult;
|
||||
}
|
||||
private void saveAddress2CargoInfo(String id, List<OmsCargoInfoDTO> cargoInfoList, List<OmsAddressMultiDTO> loadingAddressList, List<OmsAddressMultiDTO> unloadAddressList) {
|
||||
|
||||
@@ -1356,7 +1637,8 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
|
||||
|
||||
@Override
|
||||
public Result<?> batchConfirmReservationOrder(List<String> goodsNumbers) {
|
||||
public Result<?> batchConfirmReservationOrder(BusinessAuditDTO businessAuditDTO) {
|
||||
List<String> goodsNumbers = businessAuditDTO.getGoodsNumber();
|
||||
BatchConfirmResult result = new BatchConfirmResult();
|
||||
result.setTotal(goodsNumbers.size());
|
||||
result.setSuccessList(new ArrayList<>());
|
||||
@@ -1365,8 +1647,17 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
// 同步处理,避免线程池问题
|
||||
for (String goodsNumber : goodsNumbers) {
|
||||
try {
|
||||
BusinessDocumentOrderPO businessOrder = confirmReservationOrder(goodsNumber);
|
||||
result.getSuccessList().add(businessOrder);
|
||||
Boolean businessOrder = confirmReservationOrder(goodsNumber);
|
||||
if (businessOrder) {
|
||||
|
||||
} else {
|
||||
result.getFailList().add(new BatchConfirmResult.FailItem(goodsNumber, "确认失败"));
|
||||
}
|
||||
ReservationOrder reservationOrder = resevationOrderMapper.selectOne(new LambdaQueryWrapper<ReservationOrder>().eq(ReservationOrder::getGoodsNumber, goodsNumber));
|
||||
reservationOrder.setSalesManager(businessAuditDTO.getSalesManager());
|
||||
reservationOrder.setReviewOpinion(businessAuditDTO.getReviewOpinion());
|
||||
reservationOrder.setSalesmanName(businessAuditDTO.getSalesmanName());
|
||||
resevationOrderMapper.updateById(reservationOrder);
|
||||
result.setSuccessCount(result.getSuccessCount() + 1);
|
||||
} catch (Exception e) {
|
||||
result.getFailList().add(new BatchConfirmResult.FailItem(goodsNumber, e.getMessage()));
|
||||
@@ -1389,6 +1680,84 @@ public class OmsAddressMultiService implements IOmsAddressMultiService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Integer, Long> countByOrderType() {
|
||||
// 使用MyBatis Plus的LambdaQueryWrapper进行分组统计
|
||||
Map<Integer, Long> countMap = new HashMap<>();
|
||||
|
||||
// 查询所有非删除的订单,按orderType值分别计数
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
LambdaQueryWrapper<ReservationOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ReservationOrder::getIsDelete, 0)
|
||||
.eq(ReservationOrder::getOrderType, i);
|
||||
long count = resevationOrderMapper.selectCount(queryWrapper);
|
||||
countMap.put(i, count);
|
||||
}
|
||||
|
||||
return countMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer cancelReserve(List<String> goodsNumbers) {
|
||||
int count = 0;
|
||||
|
||||
for (String goodsNumber : goodsNumbers) {
|
||||
|
||||
LambdaQueryWrapper<ReservationOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ReservationOrder::getGoodsNumber, goodsNumber);
|
||||
ReservationOrder reservationOrder = resevationOrderMapper.selectOne(queryWrapper);
|
||||
List<BusinessDocumentOrder> businessDocumentOrders = businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>().eq(BusinessDocumentOrder::getGoodsNumber, goodsNumber));
|
||||
if (businessDocumentOrders != null && businessDocumentOrders.size() > 0) {
|
||||
BusinessDocumentOrder businessDocumentOrder = businessDocumentOrders.get(0);
|
||||
Long orderStatus = businessDocumentOrder.getOrderStatus();
|
||||
if (orderStatus ==0L || orderStatus == 1L) {
|
||||
businessDocumentOrder.setOrderStatus(4L);
|
||||
businessDocumentOrderMapper.updateById(businessDocumentOrder);
|
||||
reservationOrder.setOrderType(5);
|
||||
resevationOrderMapper.updateById(reservationOrder);
|
||||
count++;
|
||||
|
||||
}else {
|
||||
throw new ServiceException("订单进行中无法取消,请联系运营人员处理");
|
||||
}
|
||||
}else {
|
||||
reservationOrder.setOrderType(5);
|
||||
resevationOrderMapper.updateById(reservationOrder);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
// 返回成功修改的条数
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OmsOrderDTO getResevationOrderInfo(String goodsNumber) {
|
||||
OmsOrderDTO omsOrderDTO = new OmsOrderDTO();
|
||||
ReservationOrder reservationOrder = resevationOrderMapper.selectOne(new LambdaQueryWrapper<ReservationOrder>().eq(ReservationOrder::getGoodsNumber, goodsNumber));
|
||||
if (reservationOrder == null) {
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
BeanUtils.copyProperties(reservationOrder, omsOrderDTO);
|
||||
Long id = reservationOrder.getId();
|
||||
List<ReservationCargoInfo> reservationCargoInfos = reservationCargoInfoMapper.selectList(new LambdaQueryWrapper<ReservationCargoInfo>().eq(ReservationCargoInfo::getOrderId, id));
|
||||
if (reservationCargoInfos != null && reservationCargoInfos.size() > 0) {
|
||||
omsOrderDTO.setReservationCargoInfo(reservationCargoInfos);
|
||||
}
|
||||
ReservationAddressMulti loadingAddressMulti = reservationAddressMultiMapper.selectOne(new LambdaQueryWrapper<ReservationAddressMulti>().eq(ReservationAddressMulti::getOrderId, id).eq(ReservationAddressMulti::getLayType,1).eq(ReservationAddressMulti::getDelFlag, 1));
|
||||
if (loadingAddressMulti != null) {
|
||||
omsOrderDTO.setLoadingAddressMulti(loadingAddressMulti);
|
||||
}
|
||||
ReservationAddressMulti unloadAddressMulti = reservationAddressMultiMapper.selectOne(new LambdaQueryWrapper<ReservationAddressMulti>().eq(ReservationAddressMulti::getOrderId, id).eq(ReservationAddressMulti::getLayType,2).eq(ReservationAddressMulti::getDelFlag, 1));
|
||||
if (unloadAddressMulti != null) {
|
||||
omsOrderDTO.setUnloadAddressMulti(unloadAddressMulti);
|
||||
}
|
||||
|
||||
|
||||
return omsOrderDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> batchRejectReservationOrder(List<String> goodsNumbers) {
|
||||
BatchConfirmResult result = new BatchConfirmResult();
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.mhd.oms.interfaces.assembler.erpEnterpriseUnit;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.core.utils.IgnoreNullUtil;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.repository.todo.ErpEnterpriseUnitDO;
|
||||
import com.mhd.oms.interfaces.dto.erpEnterpriseUnit.ErpEnterpriseUnitDTO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Component
|
||||
public class ErpEnterpriseUnitAssembler {
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
*/
|
||||
public ErpEnterpriseUnitDO toDO(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO) {
|
||||
ErpEnterpriseUnitDO erpEnterpriseUnitDO = new ErpEnterpriseUnitDO();
|
||||
BeanUtils.copyProperties(erpEnterpriseUnitDTO, erpEnterpriseUnitDO, IgnoreNullUtil.getNullPropertyNames(erpEnterpriseUnitDTO));
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
String userName = loginUser.getUsername();
|
||||
Long userId = loginUser.getUserid();
|
||||
if (erpEnterpriseUnitDTO.getId() != null) {
|
||||
if (userId != null) {
|
||||
erpEnterpriseUnitDO.setUpdateBy(userId);
|
||||
} else {
|
||||
erpEnterpriseUnitDO.setUpdateBy(new Long("0"));
|
||||
}
|
||||
erpEnterpriseUnitDO.setUpdateByName(userName);
|
||||
erpEnterpriseUnitDO.setUpdateTime(new Date());
|
||||
} else {
|
||||
if (userId != null) {
|
||||
erpEnterpriseUnitDO.setCreateBy(userId);
|
||||
erpEnterpriseUnitDO.setUpdateBy(userId);
|
||||
} else {
|
||||
erpEnterpriseUnitDO.setCreateBy(new Long("0"));
|
||||
erpEnterpriseUnitDO.setUpdateBy(new Long("0"));
|
||||
}
|
||||
erpEnterpriseUnitDO.setCreateByName(userName);
|
||||
erpEnterpriseUnitDO.setUpdateByName(userName);
|
||||
erpEnterpriseUnitDO.setCreateTime(new Date());
|
||||
erpEnterpriseUnitDO.setUpdateTime(new Date());
|
||||
erpEnterpriseUnitDO.setDelFlag(1);
|
||||
}
|
||||
return erpEnterpriseUnitDO;
|
||||
}
|
||||
|
||||
}
|
||||
+6
@@ -14,11 +14,17 @@ import java.util.List;
|
||||
public class BusinessAuditDTO {
|
||||
|
||||
private List<Long> ids;
|
||||
//业务主管
|
||||
private String salesManager;
|
||||
//审核意见
|
||||
private String reviewOpinion;
|
||||
private Long reviewStatus;
|
||||
private String salesManagerName;
|
||||
private String reviewOpinionName;
|
||||
@ApiModelProperty("组织id")
|
||||
private Long organizationId;
|
||||
private List<String> goodsNumber;
|
||||
//业务员
|
||||
private String salesmanName;
|
||||
|
||||
}
|
||||
|
||||
+6
@@ -99,10 +99,16 @@ public class BusinessDocumentCargoMultiDTO extends BaseVOEntity{
|
||||
@ApiModelProperty("")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料id")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("体积")
|
||||
private BigDecimal materialVolume;
|
||||
|
||||
@ApiModelProperty("货物内容")
|
||||
private String materialContent;
|
||||
|
||||
@ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)")
|
||||
private Integer productType;
|
||||
|
||||
}
|
||||
|
||||
+64
@@ -7,6 +7,7 @@ import com.mhd.oms.domain.businessDocumentCargoMulti.entity.BusinessDocumentCarg
|
||||
import com.mhd.oms.domain.businessOrderAccount.BusinessOrderAccount;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessDocumentAddressMultiDTO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentCargoMulti.BusinessDocumentCargoMultiDTO;
|
||||
import com.mhd.oms.interfaces.dto.originalImportExportDocument.OrderWithMaterialDTO;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@@ -671,6 +672,8 @@ public class BusinessDocumentOrderDTO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date documentDate;
|
||||
|
||||
|
||||
@@ -777,6 +780,23 @@ public class BusinessDocumentOrderDTO extends BaseVOEntity{
|
||||
@ApiModelProperty("仓库负责人电话")
|
||||
private String directorPhone;
|
||||
|
||||
@ApiModelProperty("进出口方式:I-进口,E-出口")
|
||||
private String ieType;
|
||||
|
||||
@ApiModelProperty("推送状态:1-未推送 2-推送中 3-推送成功 4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private String pushBy;
|
||||
|
||||
@ApiModelProperty("推送人姓名")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty("业务单地址集合")
|
||||
private List<BusinessDocumentAddressMultiDTO> businessDocumentAddressMultiDTOList;
|
||||
|
||||
@@ -796,4 +816,48 @@ public class BusinessDocumentOrderDTO extends BaseVOEntity{
|
||||
@ApiModelProperty("费用科目明细")
|
||||
private List<BusinessOrderAccount> businessOrderAccountList;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty(value = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty(value = "净重")
|
||||
private BigDecimal weightLimit;
|
||||
|
||||
@ApiModelProperty(value = "毛重")
|
||||
private BigDecimal grossWeight;
|
||||
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty(value = "申报单位")
|
||||
private String declarationUnit;
|
||||
|
||||
@ApiModelProperty(value = "原产国")
|
||||
private String originCountry;
|
||||
|
||||
@ApiModelProperty(value = "物料明细列表")
|
||||
private List<OrderWithMaterialDTO> orderWithMaterialDTOList;
|
||||
|
||||
@ApiModelProperty(value = "单证日期起")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date documentDateStart;
|
||||
|
||||
@ApiModelProperty(value = "单证日期止")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date documentDateEnd;
|
||||
|
||||
@ApiModelProperty(value = "推送时间起")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTimeStart;
|
||||
|
||||
@ApiModelProperty(value = "推送时间止")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTimeEnd;
|
||||
}
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.mhd.oms.interfaces.dto.businessPartner;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "商业合作伙伴DTO")
|
||||
public class BusinessPartnerDTO {
|
||||
|
||||
@ApiModelProperty(value = "登录账号")
|
||||
private String userAccount;
|
||||
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String shipperEnterpriseName;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty(value = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间起")
|
||||
private String createTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "创建时间止")
|
||||
private String createTimeTo;
|
||||
|
||||
@ApiModelProperty(value = "更新时间起")
|
||||
private String updateTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "更新时间止")
|
||||
private String updateTimeTo;
|
||||
|
||||
@ApiModelProperty(value = "推送时间起")
|
||||
private String pushTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "推送时间止")
|
||||
private String pushTimeTo;
|
||||
|
||||
@ApiModelProperty(value = "推送状态")
|
||||
private Integer pushStatus;
|
||||
|
||||
@ApiModelProperty(value = "货主类型:1-个人,2-企业")
|
||||
private Integer shipperType;
|
||||
|
||||
@ApiModelProperty(value = "页码")
|
||||
private Integer pageNum = 1;
|
||||
|
||||
@ApiModelProperty(value = "每页数量")
|
||||
private Integer pageSize = 10;
|
||||
|
||||
@ApiModelProperty(value = "合作伙伴代码")
|
||||
private String corpCode;
|
||||
|
||||
@ApiModelProperty(value = "公司中文名称")
|
||||
private String corpName;
|
||||
|
||||
@ApiModelProperty(value = "货主id")
|
||||
private String shipperId;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.mhd.oms.interfaces.dto.erpCountry;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "企业国别DTO")
|
||||
public class ErpCountryDTO {
|
||||
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "ERP国别编码")
|
||||
private String erpCountryCode;
|
||||
|
||||
@ApiModelProperty(value = "ERP国别名称")
|
||||
private String erpCountryName;
|
||||
|
||||
@ApiModelProperty(value = "推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@ApiModelProperty(value = "推送时间起")
|
||||
private String pushTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "推送时间止")
|
||||
private String pushTimeTo;
|
||||
|
||||
@ApiModelProperty(value = "所属组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty(value = "所属组织ID")
|
||||
private Long TopOrganizationId;
|
||||
|
||||
@ApiModelProperty(value = "页码")
|
||||
private Integer pageNum = 1;
|
||||
|
||||
@ApiModelProperty(value = "每页数量")
|
||||
private Integer pageSize = 10;
|
||||
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.mhd.oms.interfaces.dto.erpEnterpriseUnit;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "企业单位DTO")
|
||||
public class ErpEnterpriseUnitDTO {
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "ERP单位编码")
|
||||
private String erpCode;
|
||||
|
||||
@ApiModelProperty(value = "ERP单位名称")
|
||||
private String erpName;
|
||||
|
||||
@ApiModelProperty(value = "推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@ApiModelProperty(value = "推送时间")
|
||||
private String pushTime;
|
||||
|
||||
@ApiModelProperty(value = "推送时间起")
|
||||
private String pushTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "推送时间止")
|
||||
private String pushTimeTo;
|
||||
|
||||
@ApiModelProperty(value = "推送人")
|
||||
private String pushBy;
|
||||
|
||||
@ApiModelProperty(value = "所属组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty(value = "所属组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间起")
|
||||
private String createTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "创建时间止")
|
||||
private String createTimeTo;
|
||||
|
||||
@ApiModelProperty(value = "页码")
|
||||
private Integer pageNum = 1;
|
||||
|
||||
@ApiModelProperty(value = "每页数量")
|
||||
private Integer pageSize = 10;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.mhd.oms.interfaces.dto.exchangeRate;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "汇率批量推送DTO")
|
||||
public class ExchangeRateDTO {
|
||||
|
||||
@ApiModelProperty(value = "汇率ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "币种编码(ERP编码)")
|
||||
private String erpCurrCode;
|
||||
|
||||
@ApiModelProperty(value = "币种名称(ERP名称)")
|
||||
private String erpCurrName;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.mhd.oms.interfaces.dto.gwLog;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@Data
|
||||
public class GwLogDTO {
|
||||
|
||||
|
||||
@ApiModelProperty("日志类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("业务Id")
|
||||
private Long businessId;
|
||||
|
||||
@ApiModelProperty("状态:1-初始 2-成功 3-失败")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("组织id")
|
||||
private Long organizationId ;
|
||||
|
||||
@ApiModelProperty("推送时间起")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String sendTimeFrom;
|
||||
|
||||
@ApiModelProperty("推送时间止")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String sendTimeTo;
|
||||
|
||||
@ApiModelProperty("一级组织id")
|
||||
private Long topOrganizationId ;
|
||||
|
||||
@ApiModelProperty(value = "页码")
|
||||
private Integer pageNum = 1;
|
||||
|
||||
@ApiModelProperty(value = "每页数量")
|
||||
private Integer pageSize = 10;
|
||||
|
||||
}
|
||||
+819
@@ -0,0 +1,819 @@
|
||||
package com.mhd.oms.interfaces.dto.originalImportExportDocument;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OrderWithMaterialDTO {
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("进出口类型")
|
||||
private String ieType;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
||||
private Integer goodsType;
|
||||
|
||||
@ApiModelProperty("毛重(kg)")
|
||||
private BigDecimal grossWeight;
|
||||
|
||||
@ApiModelProperty("申报单位")
|
||||
private String declarationUnit;
|
||||
|
||||
@ApiModelProperty("原产国")
|
||||
private String originCountry;
|
||||
|
||||
@ApiModelProperty("单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty("净重")
|
||||
private BigDecimal weightLimit;
|
||||
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String realCreateBy;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String realCreateName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String createCompanyId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsNumber;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String loadingAreaId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String loadingName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String loadingAddress;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String loadingLongitude;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String loadingLatitude;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String loadingUnit;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String freighterName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String loadingPhone;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date loadingDate;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String unloadAreaId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String unloadName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String unloadAddress;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String unloadLongitude;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String unloadLatitude;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String dischargerName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String unloadPhone;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date unloadingData;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsTypeId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsNameId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal weightMin;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal weightMax;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsUntisId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsUntis;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long transportationModeId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String transportationName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String carType;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String carTypeName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String serviceRequireId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String serviceRequire;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long waybillFrom;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isSource;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date sourceCloseTime;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String executorId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isDelete;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String lineTitleLeft;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String lineTitleRight;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String sysOrgCode;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isCommon;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsTypeMajor;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long auditStatus;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long waybillMode;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date latestBiddingTime;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal deliveryFreight;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal collectedFreight;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal uncollectedFreight;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal collectLessFreight;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String auditBy;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date auditTime;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String businessType;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal transportationUnitPrice;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long radioValue;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String createrName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String createrPhone;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isElectricFence;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String wxaQrcode;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String appointShipperId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String createUserId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String appointShipper;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isStatus;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String signatureAddress;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String qrCodeImgUrl;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String shippingNote;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long receivableType;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String thirdPartyOrderNumber;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String dispatchOrderNumber;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String appointDriverEnterpriseId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String appointDriverEnterprise;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String cancelOrderRemark;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String orderDriverId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal goodsQuantity;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsQuantityUnitId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsQuantityUnit;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String biddingUnit;
|
||||
|
||||
@ApiModelProperty("业务单状态 0-待审核 1-待执行 2-进行中 3-已完成 4-已取消 5-运输中 6-已拦截")
|
||||
private Long orderStatus;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long splicingOrderType;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long splicingStatus;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String mainOrderId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String mainOrderNum;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String mergeOrderId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String mergeOrderNum;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long payerType;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String machineNumber;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long stockFlag;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal infoFee;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long infoFeePayeeType;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String infoFeePayee;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long infoFeeStatus;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String infoFeeDocumentNumber;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long orderShippingType;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String recipientId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String recipientName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long settlementStatus;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date settlementTime;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date paymentTime;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String reconciliationInnerNumber;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String receivePaymentNumber;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String invoiceId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isInvoice;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String vehicleTypeId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String vehicleTypeName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String carrier;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String carrierName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long szwlUserId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal freightUnitPrice;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long biddingStatus;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String biddingRemarks;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal cargoInsuranceAmount;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String destination;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal freightCharges;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String payer;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String salesmanId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isDeclare;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String route;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String containerType;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String containerTypeName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String cardType;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String cardTypeName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String externalContainerNo;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String transitPlace;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String shipper;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String customsShipper;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String customsShipperTel;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String unloadingCompany;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String contractNo;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal freightFee;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal unloadingFee;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal customsFee;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal shortageFee;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal miscellaneousFee;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal detentionFee;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String settlementCurrency;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal volume;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String detailContent;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String customsRoute;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String customsPort;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String customsContact;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String customsContactPhone;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String customsRemark;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String orgId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String goodsCategory;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String makerCodeNc;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String salesmanCodeNc;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String customerCodeNc;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String salesmanName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String orgName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date documentDate;
|
||||
|
||||
|
||||
@ApiModelProperty( "审核状态 0-未审核 1-审核通过 2-已驳回")
|
||||
private Long reviewStatus;
|
||||
|
||||
@ApiModelProperty("审核时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date reviewTime;
|
||||
|
||||
@ApiModelProperty("审核人id")
|
||||
private Long reviewId;
|
||||
|
||||
@ApiModelProperty("审核人")
|
||||
private String review;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long EXECUTE_STATUS;
|
||||
|
||||
@ApiModelProperty( "执行状态 0-无状态 1-未执行 2-已执行 3-已下发")
|
||||
private Long executeStatus;
|
||||
|
||||
@ApiModelProperty("执行时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date executeTime;
|
||||
|
||||
@ApiModelProperty("执行人id")
|
||||
private Long executeId;
|
||||
|
||||
@ApiModelProperty("审核人")
|
||||
private String executor;
|
||||
|
||||
@ApiModelProperty("预约单id")
|
||||
private Long reservationOrderId ;
|
||||
|
||||
@ApiModelProperty("预约单号")
|
||||
private String reservationOrderNumber;
|
||||
|
||||
@ApiModelProperty("执行单id")
|
||||
private String executeOrderId;
|
||||
|
||||
@ApiModelProperty("执行单号")
|
||||
private String executeOrderNumber;
|
||||
|
||||
@ApiModelProperty("收款账户id")
|
||||
private String paymentAccountId;
|
||||
|
||||
@ApiModelProperty("收款账户信息")
|
||||
private String accountInformation;
|
||||
|
||||
@ApiModelProperty("业务类型")
|
||||
private Integer businessCategory;
|
||||
|
||||
@ApiModelProperty(value = "组织地址")
|
||||
private String companyAddress;
|
||||
|
||||
@ApiModelProperty(value = "组织公司名称")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty(value = "组织公司名称英文")
|
||||
private String companyNameEn;
|
||||
|
||||
@ApiModelProperty(value = "负责人姓名")
|
||||
private String contact;
|
||||
|
||||
@ApiModelProperty(value = "组织负责人id")
|
||||
private String contactPhone;
|
||||
|
||||
@ApiModelProperty(value = "账户名称")
|
||||
private String accountName;
|
||||
|
||||
@ApiModelProperty(value = "开户银行")
|
||||
private String accountBank;
|
||||
|
||||
@ApiModelProperty(value = "业务主管")
|
||||
private String salesManager;
|
||||
|
||||
@ApiModelProperty(value = "审核意见")
|
||||
private String reviewOpinion;
|
||||
|
||||
@ApiModelProperty(value = "订单来源")
|
||||
private String orderSource;
|
||||
|
||||
@ApiModelProperty(value = "出入库单号")
|
||||
private String entryNumber;
|
||||
|
||||
@ApiModelProperty("预计出发日期")
|
||||
private Date layDate;
|
||||
|
||||
@ApiModelProperty("出入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("仓库负责人")
|
||||
private String directorName;
|
||||
|
||||
@ApiModelProperty("仓库负责人电话")
|
||||
private String directorPhone;
|
||||
|
||||
@ApiModelProperty("仓库负责人电话")
|
||||
private BigDecimal CargoNum;
|
||||
|
||||
@ApiModelProperty("币制")
|
||||
private BigDecimal currency;
|
||||
|
||||
@ApiModelProperty("包装规格")
|
||||
private BigDecimal packName;
|
||||
|
||||
@ApiModelProperty("推送状态:1-未推送 2-推送中 3-推送成功 4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private String pushBy;
|
||||
|
||||
@ApiModelProperty("推送人姓名")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty("物料id")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)")
|
||||
private Integer productType;
|
||||
|
||||
@ApiModelProperty("物料ID列表")
|
||||
private List<Long> materialBaseInfoIdList;
|
||||
|
||||
@ApiModelProperty("商品类型列表")
|
||||
private List<Integer> productTypeList;
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.oms.domain.reservationOrder.entity.ReservationAddressMulti;
|
||||
import com.mhd.oms.domain.reservationOrder.entity.ReservationCargoInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -29,6 +31,10 @@ public class OmsOrderDTO {
|
||||
//
|
||||
// @ApiModelProperty(value = "运距(千米)")
|
||||
// private BigDecimal haulDistance;
|
||||
@ApiModelProperty(value = "订单创建时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
@ApiModelProperty(value = "订单开始时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@@ -786,5 +792,22 @@ public class OmsOrderDTO {
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
private String businessOrderNumber;
|
||||
|
||||
@ApiModelProperty("货物信息")
|
||||
private List<ReservationCargoInfo> reservationCargoInfo;
|
||||
|
||||
@ApiModelProperty("装货地址")
|
||||
private ReservationAddressMulti loadingAddressMulti;
|
||||
|
||||
@ApiModelProperty("卸货地址")
|
||||
private ReservationAddressMulti unloadAddressMulti;
|
||||
|
||||
@ApiModelProperty("业务主管")
|
||||
private String salesManager;
|
||||
@ApiModelProperty("审核意见")
|
||||
private String reviewOpinion;
|
||||
@ApiModelProperty("起运时间")
|
||||
private Date departureTime;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.mhd.oms.interfaces.facade.businessPartner;
|
||||
|
||||
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.application.service.businessPartner.BusinessPartnerApplicationService;
|
||||
import com.mhd.oms.interfaces.dto.businessPartner.BusinessPartnerDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/businessPartnerApi")
|
||||
public class BusinessPartnerApi {
|
||||
|
||||
@Resource
|
||||
private BusinessPartnerApplicationService businessPartnerApplicationService;
|
||||
|
||||
@ApiOperation("商业合作伙伴-分页查询委托方列表")
|
||||
@GetMapping("/shippperList")
|
||||
public TableDataInfo shipperList(BusinessPartnerDTO businessPartnerDTO){
|
||||
return businessPartnerApplicationService.queryShipperPage(businessPartnerDTO);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation("商业合作伙伴-批量推送")
|
||||
@PostMapping("/batchPush")
|
||||
public AjaxResult batchPush(@RequestBody List<BusinessPartnerDTO> businessPartnerDTOList){
|
||||
return businessPartnerApplicationService.batchPush(businessPartnerDTOList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.mhd.oms.interfaces.facade.erpCountry;
|
||||
|
||||
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.application.service.erpCountry.ErpCountryApplicationService;
|
||||
import com.mhd.oms.domain.erpCountry.entity.ErpCountry;
|
||||
import com.mhd.oms.interfaces.dto.erpCountry.ErpCountryDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Api(tags = "企业国别管理")
|
||||
@RestController
|
||||
@RequestMapping("/erpCountryApi")
|
||||
public class ErpCountryApi extends BaseController{
|
||||
@Autowired
|
||||
private ErpCountryApplicationService erpCountryApplicationService;
|
||||
|
||||
@ApiOperation("查询企业国别列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ErpCountryDTO erpCountryDTO){
|
||||
startPage();
|
||||
return erpCountryApplicationService.queryList(erpCountryDTO);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑企业国别")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody ErpCountryDTO erpCountryDTO) {
|
||||
if (erpCountryDTO.getId() != null) {
|
||||
return toAjax(erpCountryApplicationService.update(erpCountryDTO));
|
||||
} else {
|
||||
return toAjax(erpCountryApplicationService.insert(erpCountryDTO));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除企业国别")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public AjaxResult deleteBatch(@RequestParam("ids") String ids) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return AjaxResult.error("没有选择要删除的数据");
|
||||
}
|
||||
List<Long> idList = new ArrayList<>();
|
||||
for (String id : ids.split(",")) {
|
||||
idList.add(Long.parseLong(id));
|
||||
}
|
||||
return toAjax(erpCountryApplicationService.deleteByIds(idList));
|
||||
}
|
||||
|
||||
@ApiOperation("批量推送企业国别")
|
||||
@PostMapping("/batchPush")
|
||||
public AjaxResult batchPush(@RequestBody List<ErpCountryDTO> dtoList) {
|
||||
return erpCountryApplicationService.batchPush(dtoList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取企业国别详情")
|
||||
@GetMapping("/getInfo")
|
||||
public AjaxResult getInfo(Long id) {
|
||||
if (id == null) {
|
||||
return AjaxResult.error("ID不能为空");
|
||||
}
|
||||
ErpCountry erpCountry = erpCountryApplicationService.getById(id);
|
||||
return AjaxResult.success(erpCountry);
|
||||
}
|
||||
|
||||
@ApiOperation("查询企业国别列表-下拉框用")
|
||||
@GetMapping("/countryList")
|
||||
public AjaxResult countryList(ErpCountryDTO erpCountryDTO){
|
||||
TableDataInfo tableDataInfo = erpCountryApplicationService.queryList(erpCountryDTO);
|
||||
return AjaxResult.success(tableDataInfo.getData());
|
||||
}
|
||||
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.mhd.oms.interfaces.facade.erpEnterpriseUnit;
|
||||
|
||||
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.application.service.erpEnterpriseUnit.ErpEnterpriseUnitApplicationService;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.entity.ErpEnterpriseUnit;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.repository.po.ErpEnterpriseUnitPO;
|
||||
import com.mhd.oms.domain.erpEnterpriseUnit.repository.todo.ErpEnterpriseUnitDO;
|
||||
import com.mhd.oms.interfaces.assembler.erpEnterpriseUnit.ErpEnterpriseUnitAssembler;
|
||||
import com.mhd.oms.interfaces.dto.erpEnterpriseUnit.ErpEnterpriseUnitDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Api(tags = "企业单位管理")
|
||||
@RestController
|
||||
@RequestMapping("/erpEnterpriseUnitApi")
|
||||
@Slf4j
|
||||
public class ErpEnterpriseUnitApi extends BaseController {
|
||||
|
||||
@Resource
|
||||
private ErpEnterpriseUnitApplicationService erpEnterpriseUnitApplicationService;
|
||||
|
||||
@Resource
|
||||
private ErpEnterpriseUnitAssembler erpEnterpriseUnitAssembler;
|
||||
|
||||
|
||||
@ApiOperation("查询企业单位列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO){
|
||||
ErpEnterpriseUnitDO erpEnterpriseUnitDO = erpEnterpriseUnitAssembler.toDO(erpEnterpriseUnitDTO);
|
||||
startPage();
|
||||
return erpEnterpriseUnitApplicationService.queryList(erpEnterpriseUnitDO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("编辑企业单位")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody ErpEnterpriseUnitDTO erpEnterpriseUnitDTO){
|
||||
if(erpEnterpriseUnitDTO.getId() !=null){
|
||||
return toAjax(erpEnterpriseUnitApplicationService.update(erpEnterpriseUnitDTO));
|
||||
}else{
|
||||
return toAjax(erpEnterpriseUnitApplicationService.insert(erpEnterpriseUnitDTO));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("批量推送企业单位")
|
||||
@PostMapping("/batchPush")
|
||||
public AjaxResult batchPush(@RequestBody List<ErpEnterpriseUnitDTO> dtoList) {
|
||||
return erpEnterpriseUnitApplicationService.batchPush(dtoList);
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除企业单位")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public AjaxResult deleteBatch(@RequestParam("ids") String ids) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return AjaxResult.error("没有选择要删除的数据");
|
||||
}
|
||||
List<Long> idList = new ArrayList<>();
|
||||
for (String id : ids.split(",")) {
|
||||
idList.add(Long.parseLong(id));
|
||||
}
|
||||
return toAjax(erpEnterpriseUnitApplicationService.deleteByIds(idList));
|
||||
}
|
||||
|
||||
@ApiOperation("获取企业单位详情")
|
||||
@GetMapping("/getInfo")
|
||||
public AjaxResult getInfo(Long id) {
|
||||
if (id == null) {
|
||||
return AjaxResult.error("ID不能为空");
|
||||
}
|
||||
ErpEnterpriseUnit erpEnterpriseUnit = erpEnterpriseUnitApplicationService.getById(id);
|
||||
return AjaxResult.success(erpEnterpriseUnit);
|
||||
}
|
||||
|
||||
@ApiOperation("查询企业单位列表-下拉框用")
|
||||
@GetMapping("/unitList")
|
||||
public AjaxResult unitList(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO) {
|
||||
ErpEnterpriseUnitDO erpEnterpriseUnitDO = erpEnterpriseUnitAssembler.toDO(erpEnterpriseUnitDTO);
|
||||
TableDataInfo tableDataInfo = erpEnterpriseUnitApplicationService.queryList(erpEnterpriseUnitDO);
|
||||
return AjaxResult.success(tableDataInfo.getData());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.mhd.oms.interfaces.facade.exchangeRate;
|
||||
|
||||
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.application.service.exchangeRate.ExchangeRateApplicationService;
|
||||
import com.mhd.oms.interfaces.dto.exchangeRate.ExchangeRateDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.mhd.common.core.utils.PageUtils.startPage;
|
||||
|
||||
|
||||
@Api(tags = "汇率管理")
|
||||
@RestController
|
||||
@RequestMapping("/exchangeRateApi")
|
||||
public class ExchangeRateApi {
|
||||
|
||||
@Resource
|
||||
private ExchangeRateApplicationService exchangeRateApplicationService;
|
||||
|
||||
@ApiOperation("查询汇率列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(value = "pushStatus", required = false) String pushStatus,
|
||||
@RequestParam(value = "organizationId", required = false) String organizationId) {
|
||||
startPage();
|
||||
return exchangeRateApplicationService.queryExchangeRateList(pageNum, pageSize, pushStatus, organizationId);
|
||||
}
|
||||
|
||||
@ApiOperation("批量推送汇率")
|
||||
@PostMapping("/batchPush")
|
||||
public AjaxResult batchPush(@RequestBody List<ExchangeRateDTO> exchangeRateDTOList) {
|
||||
return exchangeRateApplicationService.batchPushExchangeRate(exchangeRateDTOList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.mhd.oms.interfaces.facade.gwLog;
|
||||
|
||||
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.application.service.gwLog.GwLogApplicationService;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.po.GwLogPO;
|
||||
import com.mhd.oms.interfaces.dto.gwLog.GwLogDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
@Api(tags = "GW日志管理")
|
||||
@RestController
|
||||
@RequestMapping("/gwLogApi")
|
||||
public class GwLogApi extends BaseController {
|
||||
|
||||
@Resource
|
||||
private GwLogApplicationService gwLogApplicationService;
|
||||
|
||||
|
||||
@ApiOperation("查询GW日志")
|
||||
@GetMapping("/queryList")
|
||||
public TableDataInfo queryList(GwLogDTO gwLogDTO){
|
||||
startPage();
|
||||
return gwLogApplicationService.queryList(gwLogDTO);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation("查询GW日志")
|
||||
@PostMapping("/selectByTypeAndId")
|
||||
public AjaxResult selectByTypeAndId(@RequestBody GwLogDTO gwLogDTO){
|
||||
GwLogPO po = gwLogApplicationService.selectByTypeAndId(gwLogDTO);
|
||||
if (po == null)
|
||||
{
|
||||
return AjaxResult.error(500,"该项数据未推送过/数据错误");
|
||||
}
|
||||
AjaxResult ajaxResult = new AjaxResult();
|
||||
ajaxResult.put("code",200);
|
||||
ajaxResult.put("data",po);
|
||||
return ajaxResult;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.mhd.oms.interfaces.facade.materialInfo;
|
||||
|
||||
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.application.service.materialInfo.MaterialInfoApplicationService;
|
||||
import com.mhd.system.api.domain.MaterialInfoDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Api(tags = "物料信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/materialInfoApi")
|
||||
public class MaterialInfoApi extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private MaterialInfoApplicationService materialInfoApplicationService;
|
||||
|
||||
@ApiOperation("查询物料信息列表")
|
||||
@GetMapping("/queryList")
|
||||
public TableDataInfo queryList(MaterialInfoDTO materialInfoDTO){
|
||||
startPage();
|
||||
TableDataInfo tableDataInfo = materialInfoApplicationService.queryList(materialInfoDTO);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
@ApiOperation("批量推送物料")
|
||||
@PostMapping("/batchPush")
|
||||
public AjaxResult batchPush(@RequestBody List<MaterialInfoDTO> dtoList) {
|
||||
return materialInfoApplicationService.batchPush(dtoList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
package com.mhd.oms.interfaces.facade.originalImportExportDocument;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.application.service.businessDocumentOrder.BusinessDocumentOrderApplicationService;
|
||||
import com.mhd.oms.domain.businessDocumentCargoMulti.entity.BusinessDocumentCargoMulti;
|
||||
import com.mhd.oms.domain.businessDocumentCargoMulti.repository.mapper.BusinessDocumentCargoMultiMapper;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.todo.BusinessDocumentOrderDO;
|
||||
import com.mhd.oms.interfaces.assembler.businessDocumentOrder.BusinessDocumentOrderAssembler;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentOrder.BusinessDocumentOrderDTO;
|
||||
import com.mhd.oms.interfaces.dto.originalImportExportDocument.OrderWithMaterialDTO;
|
||||
import com.mhd.system.api.WmsServiceFeign;
|
||||
import com.mhd.system.api.domain.MaterialInfoDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "进出口原始单证")
|
||||
@RestController
|
||||
@RequestMapping("/OriginalImportExportDocumentApi")
|
||||
public class OriginalImportExportDocumentApi extends BaseController {
|
||||
|
||||
@Resource
|
||||
BusinessDocumentCargoMultiMapper businessDocumentCargoMultiMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessDocumentOrderApplicationService businessDocumentOrderApplicationService;
|
||||
|
||||
@Resource
|
||||
private BusinessDocumentOrderAssembler businessDocumentOrderAssembler;
|
||||
|
||||
@Resource
|
||||
private WmsServiceFeign wmsServiceFeign;
|
||||
|
||||
@ApiOperation("进出口原始单证查询列表")
|
||||
@GetMapping("/list1")
|
||||
public TableDataInfo list1(BusinessDocumentOrderDTO businessDocumentOrderDTO,
|
||||
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
BusinessDocumentOrderDO businessDocumentOrderDO = businessDocumentOrderAssembler.toDO(businessDocumentOrderDTO);
|
||||
PageHelper.startPage(pageNo, pageSize);
|
||||
List<BusinessDocumentOrderPO> orderList = businessDocumentOrderApplicationService.queryListAndMaterial(businessDocumentOrderDO);
|
||||
|
||||
Page<BusinessDocumentOrderPO> page = (Page<BusinessDocumentOrderPO>) orderList;
|
||||
List<OrderWithMaterialDTO> resultList = convertToOrderWithMaterialList(orderList);
|
||||
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(resultList);
|
||||
tableDataInfo.setTotal(page.getTotal());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
@ApiOperation("删改单申请")
|
||||
@PostMapping("/reviseApply")
|
||||
public AjaxResult reviseApply(@RequestParam BusinessDocumentOrderDTO businessDocumentOrderDTO) {
|
||||
|
||||
businessDocumentOrderApplicationService.reviseApply(businessDocumentOrderDTO);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation("批量推送")
|
||||
@PostMapping("/batchPush")
|
||||
public AjaxResult batchPush(@RequestBody List<BusinessDocumentOrderDTO> businessDocumentOrderDTOList){
|
||||
if(businessDocumentOrderDTOList.isEmpty() || businessDocumentOrderDTOList == null){
|
||||
return AjaxResult.error("没有数据需要推送");
|
||||
}
|
||||
return businessDocumentOrderApplicationService.batchPushForOriginalImportExportDocument(businessDocumentOrderDTOList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation("进出口原始单证查询列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BusinessDocumentOrderDTO businessDocumentOrderDTO,
|
||||
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
BusinessDocumentOrderDO businessDocumentOrderDO = businessDocumentOrderAssembler.toDO(businessDocumentOrderDTO);
|
||||
PageHelper.startPage(pageNo, pageSize);
|
||||
List<BusinessDocumentOrderPO> orderList = businessDocumentOrderApplicationService.queryListAndMaterial(businessDocumentOrderDO);
|
||||
|
||||
// ✅ 批量查询货物列表并设置到订单
|
||||
fillCargoInfo(orderList);
|
||||
|
||||
// ✅ 获取分页信息
|
||||
Page<BusinessDocumentOrderPO> page = (Page<BusinessDocumentOrderPO>) orderList;
|
||||
|
||||
List<OrderWithMaterialDTO> resultList = convertToOrderWithMaterialList(orderList);
|
||||
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(resultList);
|
||||
tableDataInfo.setTotal(page.getTotal());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
|
||||
private void fillCargoInfo(List<BusinessDocumentOrderPO> orderList) {
|
||||
if (orderList == null || orderList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 1. 收集所有订单ID
|
||||
List<Long> orderIds = orderList.stream()
|
||||
.map(BusinessDocumentOrderPO::getId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 2. 批量查询货物列表
|
||||
List<BusinessDocumentCargoMulti> allCargoList = businessDocumentCargoMultiMapper.selectList(
|
||||
new LambdaQueryWrapper<BusinessDocumentCargoMulti>()
|
||||
.in(BusinessDocumentCargoMulti::getOrderId, orderIds)
|
||||
);
|
||||
|
||||
// 3. 按订单ID分组
|
||||
Map<Long, List<BusinessDocumentCargoMulti>> cargoMap = allCargoList.stream()
|
||||
.collect(Collectors.groupingBy(c -> Long.valueOf(c.getOrderId())));
|
||||
|
||||
// 4. 设置到每个订单
|
||||
for (BusinessDocumentOrderPO order : orderList) {
|
||||
order.setBusinessDocumentCargoMultiList(cargoMap.get(order.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
private List<OrderWithMaterialDTO> convertToOrderWithMaterialList(List<BusinessDocumentOrderPO> orderList) {
|
||||
List<OrderWithMaterialDTO> resultList = new ArrayList<>();
|
||||
for (BusinessDocumentOrderPO order : orderList) {
|
||||
OrderWithMaterialDTO dto = new OrderWithMaterialDTO();
|
||||
BeanUtils.copyProperties(order, dto);
|
||||
|
||||
// 设置货物列表信息(多个物料ID)
|
||||
List<BusinessDocumentCargoMulti> cargoList = order.getBusinessDocumentCargoMultiList();
|
||||
if (cargoList != null && !cargoList.isEmpty()) {
|
||||
// 物料ID列表
|
||||
List<Long> materialIdList = cargoList.stream()
|
||||
.map(BusinessDocumentCargoMulti::getMaterialBaseInfoId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
dto.setMaterialBaseInfoIdList(materialIdList);
|
||||
|
||||
// 商品类型列表
|
||||
List<Integer> productTypeList = cargoList.stream()
|
||||
.map(BusinessDocumentCargoMulti::getProductType)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
dto.setProductTypeList(productTypeList);
|
||||
|
||||
// 取第一个货物的物料编码作为主显示
|
||||
dto.setMaterialCode(cargoList.get(0).getMaterialCode());
|
||||
}
|
||||
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
+109
-8
@@ -1,12 +1,18 @@
|
||||
package com.mhd.oms.interfaces.facade.resevationOrder;
|
||||
|
||||
import com.aliyun.oss.ServiceException;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.mhd.common.core.utils.sms.CommonConstant;
|
||||
import com.mhd.common.core.utils.sms.Result;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.todo.BusinessDocumentOrderDO;
|
||||
import com.mhd.oms.domain.reservationOrder.entity.ReservationOrder;
|
||||
import com.mhd.oms.domain.reservationOrder.repository.facade.IOmsAddressMultiService;
|
||||
import com.mhd.oms.domain.reservationOrder.repository.po.ReservationOrderPO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentOrder.BusinessDocumentOrderDTO;
|
||||
import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderAddDTO;
|
||||
import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderDTO;
|
||||
import com.mhd.system.api.domain.TmsTransportNote;
|
||||
@@ -17,6 +23,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
//import static com.mhd.common.core.utils.PageUtils.startPage;
|
||||
|
||||
@@ -80,19 +88,80 @@ public class ResevationOrderApi extends BaseController{
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改预约单
|
||||
*
|
||||
* @param tmsOrderAddDTO
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "货源表-修改预约单", notes = "货源表-修改预约单")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody OmsOrderAddDTO tmsOrderAddDTO) {
|
||||
Result<?> result = new Result<TmsTransportNote>();
|
||||
try {
|
||||
// 获取当前登录用户的组织信息
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||
// 设置组织ID
|
||||
if (loginUser.getUserPo().getOrganizationId() != null) {
|
||||
tmsOrderAddDTO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
}
|
||||
// 设置组织名称
|
||||
if (loginUser.getUserPo().getOrganizationName() != null) {
|
||||
tmsOrderAddDTO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
}
|
||||
// 设置上级组织ID
|
||||
if (loginUser.getUserPo().getTopOrganizationId() != null) {
|
||||
tmsOrderAddDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
}
|
||||
|
||||
omsAddressMultiService.update(tmsOrderAddDTO);
|
||||
|
||||
result.success("修改成功");
|
||||
result.setCode(CommonConstant.SC_OK_200);
|
||||
} catch (ServiceException e) {
|
||||
e.printStackTrace();
|
||||
result.error500("修改失败:"+e.getErrorMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.error500("修改失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ApiOperation("获取预约单详情")
|
||||
@GetMapping("/getResevationOrderInfo")
|
||||
public Result<?> getResevationOrderInfo(@RequestParam("goodsNumber") String goodsNumber) {
|
||||
try {
|
||||
OmsOrderDTO detail = omsAddressMultiService.getResevationOrderInfo(goodsNumber);
|
||||
if (detail == null) {
|
||||
return Result.error("未查询到该预约单信息");
|
||||
}
|
||||
return Result.ok(detail);
|
||||
} catch (Exception e) {
|
||||
return Result.error("查询预约单详情失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询【预约单】列表
|
||||
*/
|
||||
@ApiOperation("查询【预约单】列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(OmsOrderDTO omsOrderDTO)
|
||||
public TableDataInfo list(OmsOrderDTO omsOrderDTO,
|
||||
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "20") Integer pageSize)
|
||||
{
|
||||
//转换实体
|
||||
startPage();
|
||||
PageHelper.startPage(pageNo, pageSize);
|
||||
List<ReservationOrderPO> list = omsAddressMultiService.queryList(omsOrderDTO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -100,16 +169,12 @@ public class ResevationOrderApi extends BaseController{
|
||||
*/
|
||||
@ApiOperation("批量确认预约单")
|
||||
@PostMapping("/batchConfirm")
|
||||
public Result<?> batchConfirm(@RequestBody List<String> goodsNumbers) {
|
||||
public Result<?> batchConfirm(@RequestBody BusinessAuditDTO businessAuditDTO) {
|
||||
Result<?> result = new Result<>();
|
||||
try {
|
||||
if (goodsNumbers == null || goodsNumbers.isEmpty()) {
|
||||
result.error500("预约单号列表不能为空");
|
||||
return result;
|
||||
}
|
||||
|
||||
// 调用服务层方法 - 现在服务层直接返回Result
|
||||
return omsAddressMultiService.batchConfirmReservationOrder(goodsNumbers);
|
||||
return omsAddressMultiService.batchConfirmReservationOrder(businessAuditDTO);
|
||||
} catch (ServiceException e) {
|
||||
result.error500("批量确认失败: " + e.getErrorMessage());
|
||||
} catch (Exception e) {
|
||||
@@ -139,5 +204,41 @@ public class ResevationOrderApi extends BaseController{
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单状态(orderType)统计各状态的数量
|
||||
*/
|
||||
@ApiOperation("根据订单状态统计数量")
|
||||
@GetMapping("/countByOrderType")
|
||||
public Result<Map<Integer, Long>> countByOrderType() {
|
||||
Result<Map<Integer, Long>> result = new Result<>();
|
||||
try {
|
||||
Map<Integer, Long> countMap = omsAddressMultiService.countByOrderType();
|
||||
result.success("统计成功");
|
||||
result.setResult(countMap);
|
||||
result.setCode(CommonConstant.SC_OK_200);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.error500("统计失败: " + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ApiOperation("取消预约")
|
||||
@PostMapping("/cancelReserve")
|
||||
public Result<?> cancelReserve(@RequestBody List<String> goodsNumbers) {
|
||||
Result<?> result = new Result<>();
|
||||
try {
|
||||
Integer count = omsAddressMultiService.cancelReserve(goodsNumbers);
|
||||
if (count > 0) {
|
||||
return Result.ok("取消预约成功,共处理:" + count + "条");
|
||||
} else {
|
||||
return Result.error("取消预约失败,订单不存在或已取消");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("取消预约失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -67,9 +67,9 @@ public class SysTableConfigApi extends BaseController {
|
||||
@RequestParam(name="key") String key) {
|
||||
try {
|
||||
SysTableConfig config = sysTableConfigService.getByOrgIdAndKey(organizationId, key, warehouseId,shipperId);
|
||||
if (config == null) {
|
||||
return Result.ok("未找到对应配置");
|
||||
}
|
||||
// if (config == null) {
|
||||
// return Result.ok("未找到对应配置");
|
||||
// }
|
||||
return Result.ok(config);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
Reference in New Issue
Block a user