Browse Source

1.修复多装多卸计划仓库问题

2.新增三方品类模块
pull/12/head
zhenghaoyu 10 months ago
parent
commit
4f82552d0e
  1. 69
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java
  2. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataFactoryCategoryDTO.java
  3. 20
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataFactoryCategoryEntityClient.java
  4. 19
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataFactoryCategoryMapper.java
  5. 40
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataFactoryCategoryMapper.xml
  6. 17
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataFactoryCategoryService.java
  7. 49
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFactoryCategoryServiceImpl.java
  8. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  9. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

69
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java

@ -0,0 +1,69 @@
package com.logpm.basicdata.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.dto.BasicdataFactoryCategoryDTO;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.service.IBasicdataFactoryCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/factoryCategory")
@Api(value = "工厂物料映射", tags = "工厂物料映射接口")
public class BasicdataFactoryCategoryController extends BladeController {
private final IBasicdataFactoryCategoryService basicdataFactoryCategoryService;
@ResponseBody
@PostMapping("/pageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "提货单列表", notes = "传入basicdataFactoryCategoryDTO")
public R pageList(@RequestBody BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO) {
String method = "############pageList: ";
log.info(method+"请求参数{}",basicdataFactoryCategoryDTO);
try{
IPage<BasicdataFactoryCategoryEntity> pages = basicdataFactoryCategoryService.pageList(basicdataFactoryCategoryDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
@ResponseBody
@PostMapping("/save")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "提货单列表", notes = "传入basicdataFactoryCategoryDTO")
public R save(@RequestBody BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO) {
String method = "############save: ";
log.info(method+"请求参数{}",basicdataFactoryCategoryDTO);
try{
return basicdataFactoryCategoryService.saveEntity(basicdataFactoryCategoryDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataFactoryCategoryDTO.java

@ -0,0 +1,12 @@
package com.logpm.basicdata.dto;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import lombok.Data;
@Data
public class BasicdataFactoryCategoryDTO extends BasicdataFactoryCategoryEntity {
private Integer pageSize;
private Integer pageNum;
}

20
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataFactoryCategoryEntityClient.java

@ -0,0 +1,20 @@
package com.logpm.basicdata.feign;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.service.IBasicdataFactoryCategoryService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class BasicdataFactoryCategoryEntityClient implements IBasicdataFactoryCategoryClient{
private final IBasicdataFactoryCategoryService factoryCategoryService;
@Override
public BasicdataFactoryCategoryEntity findEntityByAdvanceDetailIds(Integer current, Integer size) {
return null;
}
}

19
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataFactoryCategoryMapper.java

@ -0,0 +1,19 @@
package com.logpm.basicdata.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.BasicdataFactoryCategoryDTO;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface BasicdataFactoryCategoryMapper extends BaseMapper<BasicdataFactoryCategoryEntity> {
IPage<BasicdataFactoryCategoryEntity> pageList(IPage<Object> page,@Param("param") BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO);
BasicdataFactoryCategoryEntity findEntityByParam(@Param("param") BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO);
}

40
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataFactoryCategoryMapper.xml

@ -0,0 +1,40 @@
<?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.basicdata.mapper.BasicdataFactoryCategoryMapper">
<select id="pageList" resultType="com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity">
select *
from logpm_basicdata_factory_category
where 1=1
<if test="param.brand != null and param.brand != ''">
and brand = #{param.brand}
</if>
</select>
<select id="findEntityByParam" resultType="com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity">
select *
from logpm_basicdata_factory_category
where 1=1
and brand = #{param.brand}
and is_deleted = 0
<if test="param.firsts == null or param.firsts == ''">
and (firsts is null or firsts = '')
</if>
<if test="param.firsts != null and param.firsts != ''">
and firsts = #{param.firsts}
</if>
<if test="param.seconds == null or param.seconds == ''">
and (seconds is null or seconds = '')
</if>
<if test="param.seconds != null and param.seconds != ''">
and seconds = #{param.seconds}
</if>
<if test="param.thirds == null or param.thirds == ''">
and (thirds is null or thirds = '')
</if>
<if test="param.thirds != null and param.thirds != ''">
and thirds = #{param.thirds}
</if>
</select>
</mapper>

17
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataFactoryCategoryService.java

@ -0,0 +1,17 @@
package com.logpm.basicdata.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.BasicdataFactoryCategoryDTO;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.entity.BasicdataFreightEntity;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
public interface IBasicdataFactoryCategoryService extends BaseService<BasicdataFactoryCategoryEntity> {
IPage<BasicdataFactoryCategoryEntity> pageList(BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO);
R saveEntity(BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO);
}

49
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFactoryCategoryServiceImpl.java

@ -0,0 +1,49 @@
package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.dto.BasicdataFactoryCategoryDTO;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.mapper.BasicdataFactoryCategoryMapper;
import com.logpm.basicdata.service.IBasicdataFactoryCategoryService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Slf4j
@Service
@AllArgsConstructor
public class BasicdataFactoryCategoryServiceImpl extends BaseServiceImpl<BasicdataFactoryCategoryMapper, BasicdataFactoryCategoryEntity> implements IBasicdataFactoryCategoryService {
@Override
public IPage<BasicdataFactoryCategoryEntity> pageList(BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(basicdataFactoryCategoryDTO.getPageNum());
page.setSize(basicdataFactoryCategoryDTO.getPageSize());
IPage<BasicdataFactoryCategoryEntity> pageList = baseMapper.pageList(page,basicdataFactoryCategoryDTO);
return pageList;
}
@Override
public R saveEntity(BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO) {
BasicdataFactoryCategoryEntity basicdataFactoryCategoryEntity = baseMapper.findEntityByParam(basicdataFactoryCategoryDTO);
if(Objects.isNull(basicdataFactoryCategoryEntity)){
log.warn("############saveEntity: 已存在该配置");
return R.fail(405,"已存在该配置");
}
save(basicdataFactoryCategoryDTO);
return R.success("保存成功");
}
}

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -42,18 +42,20 @@
</select>
<select id="findGoodsListByAdvanceIds" resultType="com.logpm.trunkline.vo.AdvanceDetailGoodsVO">
select ltad.first_pack_name goodsName,
select IFNULL(lbc.name,'其他') goodsName,
ltad.charge_type chargeType,
sum(ltad.quantity) num,
sum(ltad.weight) weight,
sum(ltad.volume) volume
from logpm_trunkline_advance_detail ltad
left join logpm_basicdata_factory_category lbfc on lbfc.brand = ltad.brand and lbfc.firsts = ltad.first_pack_name and lbfc.seconds = ltad.second_pack_name and lbfc.thirds = ltad.third_pack_name
left join logpm_basicdata_category lbc on lbc.id = lbfc.category_id
where ltad.is_deleted = 0
and ltad.advance_id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
group by ltad.first_pack_name,
group by IFNULL(lbc.name,'其他'),
ltad.charge_type
</select>

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -1208,6 +1208,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("###############updateCarsLoadBasicData: 配载计划不存在 loadId={}", loadId);
return R.fail(405, "配载计划不存在");
}
TrunklineCarsLoadLineEntity currentLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
if(Objects.isNull(currentLoadLineEntity)){
log.warn("###############updateCarsLoadBasicData: 配载计划节点不存在 loadId={} nodeId={}", loadId,warehouseId);
return R.fail(405, "配载计划节点不存在");
}
carsLoadEntity.setDriverId(driverId);
carsLoadEntity.setAssistantId(assistantId);
carsLoadEntity.setAssistantName(assistantName);
@ -1317,6 +1323,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsOrderEntity.setId(null);
trunklineCarsOrderEntity.setLoadId(loadId);
trunklineCarsOrderEntity.setLoadLineId(carsLoadLineId);
trunklineCarsOrderEntity.setNodeId(warehouseId);
trunklineCarsOrderEntity.setNodeName(currentLoadLineEntity.getNodeName());
trunklineCarsOrderEntity.setRealNum(0);
trunklineCarsOrderEntity.setStartNum(trunklineCarsOrderDTO.getPlanNum());
trunklineCarsOrderService.save(trunklineCarsOrderEntity);

Loading…
Cancel
Save