Browse Source

Merge remote-tracking branch 'origin/dev' into dev

master
pref_mail@163.com 10 months ago
parent
commit
20ebf98332
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java
  2. 76
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java
  3. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java
  4. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  5. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java
  6. 64
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  7. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java
  8. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  9. 59
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  10. 37
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  11. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  12. 2
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factory/snm/entity/FactoryToken.java
  13. 4
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/config/InterceptorAdapterConfig.java
  14. 4
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/mapper/FactoryTokenMapper.java
  15. 2
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/service/IFactoryTokenService.java
  16. 3
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/service/impl/DeliveryNoteServiceImpl.java
  17. 6
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/service/impl/FactoryTokenServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java

@ -20,7 +20,7 @@ public class RedisKeyConstant {
public static final String BASIC_DATA_WAREHOUSE_LIST_KEY ="cache:basic-data-warehouse-list:";
public static final String USER_NAME_PHONE_KEY ="cache:user:id:";
public static final String FINAL_CLIENT_CODE ="final:client:code:";
}

76
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java

@ -108,70 +108,6 @@ public class BasicdataClientController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入basicdataClient")
public R<IPage<BasicdataClientVO>> list(@ApiIgnore @RequestParam Map<String, Object> basicdataClient, Query query) {
Object o = basicdataClient.get("contractStartTime");
Object o1 = basicdataClient.get("contractEntTime");
Object o2 = basicdataClient.get("pid");
basicdataClient.put("contractStartTime", null);
basicdataClient.put("contractEntTime", null);
QueryWrapper<BasicdataClientEntity> queryWrapper = Condition.getQueryWrapper(basicdataClient, BasicdataClientEntity.class);
/* queryWrapper.apply(o != null,
"date_format (contract_start_time,'%Y-%m-%d') >= date_format ({0},'%Y-%m-%d')", o)
.apply(o1 != null,
"date_format (contract_ent_time,'%Y-%m-%d') <= date_format ({0},'%Y-%m-%d')", o1);*/
if (ObjectUtils.isNotNull(o)) {
queryWrapper.between("contract_start_time", o, o1);
}
if (ObjectUtils.isNotNull(o2)) {
queryWrapper.eq("pid", o2);
} else {
queryWrapper.eq("pid", "0");
}
queryWrapper.orderByDesc("create_time");
IPage<BasicdataClientEntity> pages = basicdataClientService.page(Condition.getPage(query), queryWrapper);
pages.getRecords().forEach(i -> {
List<BasicdataStoreBusinessEntity> list = basicdataStoreBusinessService.list(Wrappers.<BasicdataStoreBusinessEntity>query().lambda()
.eq(BasicdataStoreBusinessEntity::getClientId, i.getId()));
i.setTypeServiceBusiness(list);
//查询客户绑定第一位联系人
List<BasicdataStoreContactEntity> listed = basicdataStoreContactService.list(Wrappers.<BasicdataStoreContactEntity>query().lambda()
.eq(BasicdataStoreContactEntity::getShopId, i.getId())
.eq(BasicdataStoreContactEntity::getDefaultType, true));
if (Func.isNotEmpty(listed)) {
List<BasicdataStoreContactEntity> collect = listed.stream().filter(f -> Func.isEmpty(f.getCreateTime())).collect(Collectors.toList());
if (Func.isNotEmpty(collect)){
System.out.println("客户无创建时间"+collect);
}
String string = listed.stream().sorted(Comparator.comparing(BasicdataStoreContactEntity::getCreateTime)).findFirst().map(BasicdataStoreContactEntity::getLinkman).get();
String phone = listed.stream().sorted(Comparator.comparing(BasicdataStoreContactEntity::getCreateTime)).findFirst().map(BasicdataStoreContactEntity::getPhone).get();
i.setLinkman(string);
i.setPhone(phone);
}
List<String> collect = list.stream().filter(f -> Func.isNotEmpty(f.getMold())).map(BasicdataStoreBusinessEntity::getMold).collect(Collectors.toList());
if (collect.size() > 0) {
//进行
String s = collect.get(0);
switch (s) {
case "1":
i.setTypeServiceName("商配");
break;
case "2":
i.setTypeServiceName("市配");
break;
case "3":
i.setTypeServiceName("自提");
break;
case "4":
i.setTypeServiceName("三方中转");
break;
}
}
//处理客户的配送类型
});
IPage<BasicdataClientVO> basicdataClientVOIPage = basicdataClientService.pageList(Condition.getPage(query), basicdataClient);
if (!basicdataClientVOIPage.getRecords().isEmpty()) {
for (BasicdataClientVO record : basicdataClientVOIPage.getRecords()) {
@ -194,6 +130,18 @@ public class BasicdataClientController extends BladeController {
return R.data(pages);
}
/**
* 查询最后一位客户编码
* @return
*/
@GetMapping("/getFinallyClientCode")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "查询最后一位客户编码", notes = "传入basicdataClient")
public R<String> getFinallyClientCode() {
String code = basicdataClientService.getFinallyClientCode();
return R.data(code);
}
/**
* 基础客户表查询
*/

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java

@ -71,4 +71,10 @@ public interface BasicdataClientMapper extends BaseMapper<BasicdataClientEntity>
*/
IPage<BasicdataClientVO> pageList(IPage<BasicdataClientVO> page,@Param("param") Map<String, Object> basicdataClient);
/**
* 查询规则生成的客户编码列表
* @return
*/
List<String> getFinallyClientCode();
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -117,6 +117,7 @@
WHEN 4 THEN '三方中转'
END typeServiceName,
lbhc.file_name,
lbhc.lease_accessories,
DATE_FORMAT(lbc.contract_start_time, '%Y-%m-%d') AS contractStartTime,
DATE_FORMAT(lbc.contract_ent_time, '%Y-%m-%d') AS contractEntTime,
t.aaa AS brandName
@ -170,5 +171,8 @@
lbc.create_time
DESC
</select>
<select id="getFinallyClientCode" resultType="java.lang.String">
SELECT client_code FROM `logpm_basicdata_client` WHERE is_deleted = 0 AND client_code LIKE 'HT%' AND LENGTH(client_code) = 9 ORDER BY client_code DESC
</select>
</mapper>

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java

@ -111,4 +111,10 @@ public interface IBasicdataClientService extends BaseService<BasicdataClientEnti
*/
IPage<BasicdataClientVO> pageList(IPage<BasicdataClientVO> page, Map<String, Object> basicdataClient);
/**
* 查询客户编码
* @return
*/
String getFinallyClientCode();
}

64
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -50,9 +50,11 @@ import com.logpm.basicdata.vo.BasicdataClientVO;
import com.logpm.basicdata.vo.ClientInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.model.dto.NameDTO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
@ -102,6 +104,9 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
@Autowired
private IUserClient userClient;
@Autowired
private BladeRedis redis;
@Override
public IPage<BasicdataClientVO> selectBasicdataClientPage(IPage<BasicdataClientVO> page, BasicdataClientVO basicdataClient) {
return page.setRecords(baseMapper.selectBasicdataClientPage(page, basicdataClient));
@ -122,7 +127,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
public boolean ownSaveOrUpdate(BasicdataClientEntity basicdataClient) throws NoSuchAlgorithmException {
//添加客户端的历史合同的数据
if (ObjectUtils.isNotNull(basicdataClient.getId())) {
if (!Objects.isNull(basicdataClient.getBusinessType())){
if (!Objects.isNull(basicdataClient.getBusinessType())) {
basicdataClient.setTypeService(Integer.parseInt(basicdataClient.getBusinessType()));
}
//修改
@ -158,7 +163,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
if (!stringList.isEmpty()) {
basicdataStoreBusinessService.deleteLogic(stringList);
}
}
for (String s : basicdataClient.getTypeServiceList()) {
//添加服务类型
@ -177,7 +181,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
basicdataClient.setLinkman(linkman);
basicdataClient.setPhone(phone);
basicdataClient.setCargoControl(false);
if (!Objects.isNull(basicdataClient.getBusinessType())){
if (!Objects.isNull(basicdataClient.getBusinessType())) {
basicdataClient.setTypeService(Integer.parseInt(basicdataClient.getBusinessType()));
}
if (ObjectUtils.isNull(basicdataClient.getPid())) {
@ -238,14 +242,27 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
return false;
}
if (ObjectUtils.isNotNull(basicdataClient.getLeaseAccessories())) {
//添加历史合同
BasicdataHistoricalContractEntity basicdataHistoricalContract = new BasicdataHistoricalContractEntity();
basicdataHistoricalContract.setClientId(basicdataClient.getId().toString());
basicdataHistoricalContract.setContractEntTime(basicdataClient.getContractEntTime());
basicdataHistoricalContract.setContractStartTime(basicdataClient.getContractStartTime());
basicdataHistoricalContract.setLeaseAccessories(basicdataClient.getLeaseAccessories());
basicdataHistoricalContract.setFileName(basicdataClient.getFileName());
basicdataHistoricalContractService.save(basicdataHistoricalContract);
//查询原历史合同和当前合同是否发生变更 发生变更才会进行保存
List<BasicdataHistoricalContractEntity> list = basicdataHistoricalContractService.list(Wrappers.<BasicdataHistoricalContractEntity>query().lambda()
.eq(BasicdataHistoricalContractEntity::getClientId, basicdataClient.getId())
);
boolean flag;
if (list.isEmpty()) {
flag = true;
} else {
flag = list.stream().anyMatch(f -> !f.getLeaseAccessories().equals(basicdataClient.getLeaseAccessories()));
}
if (flag) {
//添加历史合同
BasicdataHistoricalContractEntity basicdataHistoricalContract = new BasicdataHistoricalContractEntity();
basicdataHistoricalContract.setClientId(basicdataClient.getId().toString());
basicdataHistoricalContract.setContractEntTime(basicdataClient.getContractEntTime());
basicdataHistoricalContract.setContractStartTime(basicdataClient.getContractStartTime());
basicdataHistoricalContract.setLeaseAccessories(basicdataClient.getLeaseAccessories());
basicdataHistoricalContract.setFileName(basicdataClient.getFileName());
basicdataHistoricalContractService.save(basicdataHistoricalContract);
basicdataHistoricalContractService.removeBatchByIds(list);
}
}
return true;
@ -274,7 +291,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
clientIds.add(i);
});
// 删除客户品牌关系
if(CollUtil.isNotEmpty(clientIds)){
if (CollUtil.isNotEmpty(clientIds)) {
basicdataStoreBrandService.remove(Wrappers.<BasicdataStoreBrandEntity>query().lambda()
.in(BasicdataStoreBrandEntity::getClientId, clientIds));
}
@ -366,12 +383,12 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
log.info(">>>>>> basicdataClient.getClientCode() {}", basicdataClient.getClientCode());
//查询客户编码和客户名称是否存在
boolean b = basicdataClients.stream().anyMatch(ii -> {
if (ii.getClientCode()!=null && !ii.getClientCode().equals("")) {
log.info(">>>>>>>>>>>>> 1{}",ii.getClientCode());
log.info(">>>>>>>>>>>>> 2{}",ii.getClientName());
if (ii.getClientCode() != null && !ii.getClientCode().equals("")) {
log.info(">>>>>>>>>>>>> 1{}", ii.getClientCode());
log.info(">>>>>>>>>>>>> 2{}", ii.getClientName());
if (ii.getClientCode().equals(basicdataClient.getClientCode())
|| ii.getClientName().equals(basicdataClient.getClientName().trim())){
|| ii.getClientName().equals(basicdataClient.getClientName().trim())) {
return true;
}
}
@ -647,7 +664,20 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
@Override
public IPage<BasicdataClientVO> pageList(IPage<BasicdataClientVO> page, Map<String, Object> basicdataClient) {
return baseMapper.pageList(page,basicdataClient);
return baseMapper.pageList(page, basicdataClient);
}
@Override
public String getFinallyClientCode() {
String finaClientCode = redis.get(RedisKeyConstant.FINAL_CLIENT_CODE + AuthUtil.getTenantId());
if (StringUtils.isBlank(finaClientCode)) {
List<String> str = baseMapper.getFinallyClientCode();
finaClientCode = str.get(0);
redis.set(RedisKeyConstant.FINAL_CLIENT_CODE + AuthUtil.getTenantId(), finaClientCode);
}
String num = finaClientCode.replaceAll("HT", "");
int anInt = Integer.parseInt(num) + 1;
return "HT" + anInt;
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

@ -3351,6 +3351,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
Map<String, BasicdataBrandEntity> brandEntityMap, Map<String, BasicdataPriceEntity> priceEntityMap,
Map<String, BasicdataStoreBrandEntity> clientBrandMap, Map<String, List<BasicdataPriceEntity>> checkPriceEntityMap) {
if (CollUtil.isNotEmpty(priceExcels)) {
Map<String,String> checkRepeatMap = new HashMap<>();
for (int i = 0; i < priceExcels.size(); i++) {
StringBuilder rowMessage = new StringBuilder();
int rowNum = i + 2;
@ -3377,6 +3378,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
brandFlag = Boolean.TRUE;
}
}
checkRepeatMap.put(priceExcel.getClient() + priceExcel.getBrand(),priceExcel.getClient() + priceExcel.getBrand());
Boolean templateFlag = Boolean.FALSE;
if (StrUtil.isEmpty(priceExcel.getTemplateName())) {
rowMessage.append("模板名称不能为空;");
@ -3465,7 +3467,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
buildErrorMessageExcel(message, rowMessage, firstMessage);
}
if (StrUtil.isEmpty(message.toString())) {
if (CollUtil.isNotEmpty(priceEntityMap) && !ObjectUtil.equal(priceExcels.size(), clientBrandMap.size())) {
if (CollUtil.isNotEmpty(checkRepeatMap) && !ObjectUtil.equal(priceExcels.size(), checkRepeatMap.size())) {
message.append(sheet1).append("中存在 客户名称+品牌 重复的数据,请检查;");
}
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java

@ -316,7 +316,7 @@ public interface IDistributionAsyncService {
* 释放当前客户能够进行资源释放的包件包含库存品
* @param reservationId
*/
void releaseSource(Long reservationId,Long warehouseId);
void releaseSource(Long reservationId,BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber);
/**
* 进行干线日志保存

59
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -75,15 +75,8 @@ import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import com.logpm.trunkline.dto.AddWaybillTrackDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.feign.*;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehousePackageTrackLogClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
@ -120,7 +113,6 @@ import org.springblade.common.constant.signing.SignforStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@ -129,20 +121,17 @@ import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@ -1739,7 +1728,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
@Override
@Transactional
@LogpmAsync("asyncExecutor")
public void releaseSource(Long reservationId, Long warehouseId) {
public void releaseSource(Long reservationId, BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber) {
String method = "##########################DistributionAsyncServiceImpl.releaseSource";
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(reservationId);
StringBuilder builder = new StringBuilder();
@ -1747,10 +1736,12 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
//存在订单
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
if (Func.isNotEmpty(distributionParcelListEntities)) {
List<Long> packageIds = distributionParcelListEntities.stream()
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()))
.map(DistributionParcelListEntity::getId)
.collect(Collectors.toList());
if (Func.isNotEmpty(packageIds)) {
//对包件进行批量的修改
//将这些包件恢复到初始状态
@ -1758,7 +1749,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
//维护这些进行包件对应的订单
String orderCodes = distributionParcelListEntities.stream()
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()))
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
&& !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()))
.map(DistributionParcelListEntity::getOrderCode)
.distinct().collect(Collectors.joining(","));
log.info(method + "维护订制品订单:{}", orderCodes);
@ -1768,9 +1760,25 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
if(!packageIds.isEmpty() && reservationId!=null){
//完成对该客户下此包件任务的取消
int row = distributionReservationMapper.updatePackageDeliveryStatus(reservationId, packageIds);
}
List<JSONObject> aaa = new ArrayList<>();
distributionParcelListEntities.forEach(k->{
if (k.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())
&& k.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){
String content = "包件在"+warehouse.getName()+"由"+user.getNickName()+"完成复核,配送车次号:"+trainNumber+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CLERK_REVIEW.getCode());
aaa.add(js);
}else {
String content = "包件在"+warehouse.getName()+"由"+user.getNickName()+"复核取消计划无操作包件,配送车次号:"+trainNumber+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode());
aaa.add(js);
}
});
if (!aaa.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}
//维护预约订单状态
}
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(reservationId);
if (Func.isNotEmpty(distributionParcelNumberDTOS)) {
@ -1799,8 +1807,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
reservationZeroPackageService.recoverZeroPackage(reservationId, packageIds);
}
}
distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouseId);
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouseId);
distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouse.getId());
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouse.getId());
}
//存在库存品信息
@ -3011,4 +3019,23 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId",user.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",user.getUserId());
trunklinePackageTrackLog.put("updateUser",user.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",warehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",orderPackageCode);
trunklinePackageTrackLog.put("warehouseId",warehouse.getId());
trunklinePackageTrackLog.put("warehouseName",warehouse.getName());
trunklinePackageTrackLog.put("workNode",node);
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",user.getNickName());
return trunklinePackageTrackLog;
}
}

37
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -772,7 +772,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
pushList.add(parcelListEntity);
//extracteOrderPackageStatus(distrilbutionloadingscanDTO, parcelListEntity, myCurrentWarehouse, reservationEntity);
// extracteOrderPackageStatus(distrilbutionloadingscanDTO, parcelListEntity, myCurrentWarehouse, reservationEntity);
} else if (parcelListEntityList.isEmpty()) {
@ -858,7 +858,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.info("#########!!!!!!!!!!!!!!!!!--------- 55555555555 distrilbutionloadingscanDTO={}", distrilbutionloadingscanDTO);
if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())) {
//存在客户 这里就是针对客户进行的整托装车
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
Map<Long, DistributionParcelListEntity> parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2));
boolean reservationFlag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(parcelListEntityMap.get(p.getId())));
log.info("#########!!!!!!!!!!!!!!!!!--------- 6666666666 reservationFlag={}", reservationFlag);
@ -3217,6 +3216,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//新增订单
List<DistributionParcelListDTO> packageListInfo = s.getPackageListInfo();
if (Func.isNotEmpty(packageListInfo)) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "文员完成复核,无法追加订单");
}
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
@ -3239,6 +3242,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
logs.add(js);
});
} else {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "文员完成复核,无法追加订单");
}
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
@ -3361,8 +3368,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(packageListInfo)) {
packageListInfo.forEach(p -> {
if (Func.isEmpty(oldPackageList.get(p.getId()))) {
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "文员完成复核,无法追加订单");
}
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对司机完成签收订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
}
//为该订单新增了包件
@ -6089,11 +6100,21 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error("###########查询配送任务异常,deliveyId:{}", deliveryId);
return false;
}
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Func.isEmpty(reservationEntity)) {
log.error("###########查询预约任务异常,reservationId:{}", reservationId);
return false;
}
if (conditions != 1) {
log.error("###########包件类型错误,conditions:{}", conditions);
return false;
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error("###########retentionDeliveryReservationPackage未授权,warehouse:{}", myCurrentWarehouse);
return false;
}
List<JSONObject> aaa =new ArrayList<>();
//订制品
//需要对该配送任务下的该包件进行取消状态标识
int row = distributionReservationMapper.cancelReservationPackage(reservationId, orderPackageId);
@ -6116,6 +6137,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
int a = distributionSignforMapper.deductionLoadingPacjageNum(loadscanEntity.getReservationId(), loadscanEntity.getDeliveryId(), loadscanEntity.getLoadedNub());
//维护订单状态
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), parcelListEntity.getWarehouseId());
//增加滞留信息
String content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"取消配车,取消方式:滞留扫描,取消计划,配送车次号:"+loadscanEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(),content , WorkNodeEnums.CANCEL_DISTRIBUTION.getCode());
aaa.add(js);
}
if (!aaa.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}
//进行了一条包件任务的取消,此时就应该对预约、配送任务进行数量的维护
distributionAsyncService.checkRetentionReservationAndDeliveryInfo(reservationId, deliveryId);

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -630,6 +630,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.info("复核签收装车数和签收数不一致,装车数:{},签收数:{}", loadingNum,signNum);
return R.fail("存在装车还未签收数据!!!");
}
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distributionSignfor.getTrainNumber());
if (Func.isEmpty(deliveryListEntity)) {
log.error("文员复核查询配送计划失败,deliveryId:{}", distributionSignfor.getTrainNumber());
return R.fail("操作失败,请核对计划信息!!!");
}
BladeUser user = AuthUtil.getUser();
distributionSignfor.setExamineUserId(user.getUserId());
distributionSignfor.setSigningStatus(SignforStatusConstant.yiqianshou.getValue());
@ -649,7 +654,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//还需要对未装车未签收的包件进行状态的回退
boolean flag = this.judgmentSignIsHavePackage(distributionSignfor.getReservationId());
if (!flag) {
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse.getId());
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse,AuthUtil.getUser(),deliveryListEntity.getTrainNumber());
}
return R.success("操作成功");
}

2
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/entity/FactoryToken.java → blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factory/snm/entity/FactoryToken.java

@ -1,4 +1,4 @@
package com.logpm.factorydata.linsy.entity;
package com.logpm.factory.snm.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

4
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/config/InterceptorAdapterConfig.java

@ -27,9 +27,9 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry interceptorRegistry) {
interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(factoryTokenService))
.addPathPatterns("/**").order(1);
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment,redisLockClient,mockLoginService))
.addPathPatterns("/**").order(2);
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment,redisLockClient,mockLoginService))
.addPathPatterns("/**").order(1);
}
}

4
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/mapper/FactoryTokenMapper.java

@ -17,7 +17,8 @@
package com.logpm.factorydata.linsy.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.linsy.entity.FactoryToken;
import com.logpm.factory.snm.entity.FactoryToken;
import org.apache.ibatis.annotations.Mapper;
/**
* 工厂账号接口日志 Mapper 接口
@ -25,6 +26,7 @@ import com.logpm.factorydata.linsy.entity.FactoryToken;
* @author zhy
* @since 2023-03-28
*/
@Mapper
public interface FactoryTokenMapper extends BaseMapper<FactoryToken> {

2
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/service/IFactoryTokenService.java

@ -1,6 +1,6 @@
package com.logpm.factorydata.linsy.service;
import com.logpm.factorydata.linsy.entity.FactoryToken;
import com.logpm.factory.snm.entity.FactoryToken;
import org.springblade.core.mp.base.BaseService;
import java.security.NoSuchAlgorithmException;

3
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/service/impl/DeliveryNoteServiceImpl.java

@ -53,6 +53,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
@Override
@LogpmAsync("asyncExecutor")
public void buildAdvance(DeliveryNoteVO vo) {
log.info("林氏新系统生成暂存单:{}", JSONUtil.toJsonStr(vo));
// 新起线程构建暂存单发送mq
Long startWarehouseId = null;
String startWarehouseName = null;
@ -134,7 +135,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
advanceDetailEntity.setOrderPackageCode(orderPackageDTO.getBarcode());
advanceDetailEntity.setTrainNumber(StrUtil.replace(DateUtil.today(), "-", ""));
advanceDetailEntity.setServiceNum(vo.getCustomizedBillCode());
advanceDetailEntity.setWaybillNo("");
// advanceDetailEntity.setWaybillNo("");
advanceDetailEntity.setPackageStatus("0");
advanceDetailEntity.setWeight(StrUtil.isNotBlank(orderPackageDTO.getWeight()) ? new BigDecimal(orderPackageDTO.getWeight()) : BigDecimal.ZERO);
advanceDetailEntity.setVolume(StrUtil.isNotBlank(orderPackageDTO.getVolume()) ? new BigDecimal(orderPackageDTO.getVolume()) : BigDecimal.ZERO);

6
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/service/impl/FactoryTokenServiceImpl.java

@ -1,7 +1,7 @@
package com.logpm.factorydata.linsy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factorydata.linsy.entity.FactoryToken;
import com.logpm.factory.snm.entity.FactoryToken;
import com.logpm.factorydata.linsy.mapper.FactoryTokenMapper;
import com.logpm.factorydata.linsy.service.IFactoryTokenService;
import lombok.AllArgsConstructor;
@ -35,7 +35,9 @@ public class FactoryTokenServiceImpl extends BaseServiceImpl<FactoryTokenMapper,
if (Objects.isNull(factoryToken)) {
QueryWrapper<FactoryToken> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
factoryToken = baseMapper.selectOne(queryWrapper);
// TODO 由factory提供一个feign接口获取
return false;
// factoryToken = baseMapper.selectOne(queryWrapper);
}

Loading…
Cancel
Save