Browse Source

用包件码和商场名称来操作订单表 修改商场名称 id code 服务类型 收货单位

single_db
Diss 1 year ago
parent
commit
ba980bb79b
  1. 40
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java
  2. 35
      blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncServiceTypeController.java
  3. 16
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncServiceTypeMapper.java
  4. 21
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncServiceTypeMapper.xml
  5. 14
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncServiceTypeService.java
  6. 48
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncServiceTypeServiceImpl.java

40
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java

@ -52,6 +52,8 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -198,6 +200,7 @@ public class BasicdataDriverArteryController extends BladeController {
/**
* 导出数据
* http://localhost:8400/driverArtery/export-basicdataDriverArtery
*/
@GetMapping("/export-basicdataDriverArtery")
@ApiOperationSupport(order = 9)
@ -222,4 +225,41 @@ public class BasicdataDriverArteryController extends BladeController {
return R.success("操作成功");
}
/**
* 导出数据模板
* http://localhost:8400/driverArtery/export-basicdataDriverArteryMb
*/
@GetMapping("/export-basicdataDriverArteryMb")
@ApiOperationSupport(order = 10)
@ApiOperation(value = "导出数据模板", notes = "传入basicdataDriverArtery")
public void exportBasicdataDriverArteryMb(@ApiIgnore @RequestParam Map<String, Object> basicdataDriverArtery, BladeUser bladeUser, HttpServletResponse response) {
List<BasicdataDriverArteryImproterExcel> list = new ArrayList<>();
//存入模板
BasicdataDriverArteryImproterExcel excel = new BasicdataDriverArteryImproterExcel();
excel.setName("张三");
excel.setPhone("13812345678");
excel.setType("1");
excel.setJobType("1");
excel.setDrivingType("1");
excel.setBindVehicle("川A12345,川B56789");
excel.setContractStartTime(new Date());
excel.setContractEndTime(new Date());
excel.setIdCard("440123198012345678");
excel.setGender("1");
excel.setWarehouseName("龙泉仓");
excel.setResidentialAddress("四川省成都市龙泉驿区车城东六路");
excel.setBankType("1");
excel.setBankCardNub("1234567890123456789");
excel.setDriverLicenseNub("A123456789");
excel.setDriverLicenseOrgan("四川省成都市市公安局交警支队");
excel.setDriverLicenseStartTime(new Date());
excel.setDriverLicenseEndTime(new Date());
excel.setEmployeeQualificationNub("A987654321");
excel.setRoadOperationLicenseNub("B123456789");
excel.setCarrierName("汇通运输");
excel.setTransportationAgreement("运输协议123");
excel.setNotes("这是备注信息");
list.add(excel);
ExcelUtil.export(response, "司机信息数据模板" + DateUtil.time(), "司机信息数据模板表", list, BasicdataDriverArteryImproterExcel.class);
}
}

35
blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncServiceTypeController.java

@ -0,0 +1,35 @@
package com.logpm.patch.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.patch.dto.SyncInventoryDTO;
import com.logpm.patch.entity.SyncInventoryEntity;
import com.logpm.patch.service.ISyncServiceTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
/*
* logisticsplatform-service
* @Author Diss
* @Create 2024/1/15 12:30
*/
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/syncServiceType")
@Api(value = "同步订单信息控制器", tags = "同步订单信息接口")
public class SyncServiceTypeController {
private final ISyncServiceTypeService syncServiceTypeService;
@ResponseBody
@PostMapping("/change")
@ApiOperation(value = "分页", notes = "传入运单号,仓库名称,商店名称")
public R change(@RequestParam String id, @RequestParam String warehouseName, @RequestParam String mallName) {
syncServiceTypeService.syncServiceType(id, warehouseName, mallName);
return R.success("修改成功");
}
}

16
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncServiceTypeMapper.java

@ -0,0 +1,16 @@
package com.logpm.patch.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/*
* logisticsplatform-service
* @Author Diss
* @Create 2024/1/15 14:46
*/
@Mapper
public interface SyncServiceTypeMapper {
void syncServiceTypeByMallName(@Param("stockArticleId")Long stockArticleId, @Param("mallName")String mallName);
void syncServiceTypeByWarehouseName(@Param("stockArticleId")Long stockArticleId, @Param("warehouseName") String warehouseName);
}

21
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncServiceTypeMapper.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.patch.mapper.SyncServiceTypeMapper">
<update id="syncServiceTypeByMallName">
UPDATE logpm_distribution_stock_article ldsa
LEFT JOIN logpm_basicdata_client lbc ON lbc.client_name = #{mallName} AND lbc.is_deleted = 0
LEFT JOIN logpm_basicdata_store_business lbsb ON lbsb.client_id = lbc.id
SET ldsa.mall_id = COALESCE(lbc.id, ldsa.mall_id),
ldsa.mall_code = COALESCE(lbc.client_code, ldsa.mall_code),
ldsa.mall_name = COALESCE(lbc.client_name, ldsa.mall_name),
ldsa.type_service = COALESCE(lbsb.type_service, ldsa.type_service),
ldsa.consignee_unit = #{mallName}
WHERE ldsa.id = #{stockArticleId};
</update>
<update id="syncServiceTypeByWarehouseName">
</update>
</mapper>

14
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncServiceTypeService.java

@ -0,0 +1,14 @@
package com.logpm.patch.service;
/*
* logisticsplatform-service
* @Author Diss
* @Create 2024/1/15 13:57
*/
import org.springframework.web.bind.annotation.RequestParam;
public interface ISyncServiceTypeService {
void syncServiceType( String id, String warehouseName, String shopName) ;
}

48
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncServiceTypeServiceImpl.java

@ -0,0 +1,48 @@
package com.logpm.patch.service.impl;
/*
* logisticsplatform-service
* @Author Diss
* @Create 2024/1/15 14:04
*/
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.patch.controller.SyncServiceTypeController;
import com.logpm.patch.mapper.SyncServiceTypeMapper;
import com.logpm.patch.service.ISyncServiceTypeService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Log4j2
@Service
@AllArgsConstructor
public class SyncServiceTypeServiceImpl implements ISyncServiceTypeService {
private final IDistributionParcelListClient distributionParcelListClient;
private final SyncServiceTypeMapper syncServiceTypeMapper;
@Override
public void syncServiceType(String id, String warehouseName, String mallName) {
DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByOrderPackageCodeAndStatus(id);
if (distributionParcelListEntity==null){
throw new ServiceException("订单号不存在");
}
Long stockArticleId = distributionParcelListEntity.getStockArticleId();
//判断那个是仓库名称和商店名称谁是null
if (Objects.isNull(warehouseName) || warehouseName.isEmpty()){
//用订单和商店名称来操作 //修改商场名称 id code 服务类型 收货单位
syncServiceTypeMapper.syncServiceTypeByMallName(stockArticleId,mallName);
}else if(Objects.isNull(mallName) || mallName.isEmpty()){
//用订单号和仓库名称来操作
syncServiceTypeMapper.syncServiceTypeByWarehouseName(stockArticleId,warehouseName);
}else {
throw new ServiceException("请传入仓库名称或商店名称");
}
}
}
Loading…
Cancel
Save