9/29 工位维护增加上货工位

dev_no_inv
wangwei 9 months ago
parent 4d73efd7ac
commit 28bda3c70c

@ -0,0 +1,53 @@
package com.glxp.api.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.basic.BasicCollectPointEntity;
import com.glxp.api.req.basic.BasicCollectRequest;
import com.glxp.api.req.basic.CargowWorkplaceRequest;
import com.glxp.api.req.basic.WorkBindBusTypeRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.SysWorkplacePutRelResponse;
import com.glxp.api.service.thrsys.SysWorkplacePutRelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author : zhangsan
* @date : 2024/9/27 19:30
* @modyified By :
*/
@Slf4j
@RestController
public class SysWorkplacePutRelController extends BaseController {
@Resource
SysWorkplacePutRelService sysWorkplacePutRelService;
@PostMapping("/udiwms/sysWorkplace/bindCollect")
public BaseResponse bindCollect(@RequestBody CargowWorkplaceRequest request) {
BaseResponse success = sysWorkplacePutRelService.bindCollect(request,getUserId());
return success;
}
@GetMapping("/udiwms/basic/collectPoints/getBindCollectList")
public BaseResponse page(CargowWorkplaceRequest request) {
List<SysWorkplacePutRelResponse> page = sysWorkplacePutRelService.filterList(request);
PageInfo<SysWorkplacePutRelResponse> pageInfo = new PageInfo<>(page);
PageSimpleResponse<SysWorkplacePutRelResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(page);
return ResultVOUtils.success(pageSimpleResponse);
}
}

@ -0,0 +1,16 @@
package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.SysWorkplacePutRel;
import com.glxp.api.req.basic.CargowWorkplaceRequest;
import com.glxp.api.res.basic.SysWorkplacePutRelResponse;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysWorkplacePutRelMapper extends BaseMapper<SysWorkplacePutRel> {
List<SysWorkplacePutRelResponse> filterList(CargowWorkplaceRequest request);
}

@ -1,11 +0,0 @@
package com.glxp.api.dao.collect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.SysWorkplacePutRel;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysWorkplacePutRelMapper extends BaseMapper<SysWorkplacePutRel> {
}

@ -21,7 +21,7 @@ import lombok.Data;
public class SysWorkplacePutRel implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
@ApiModelProperty(value = "")
private Integer id;
private Long id;
/**
*
@ -35,7 +35,7 @@ public class SysWorkplacePutRel implements Serializable {
*/
@TableField(value = "relBusIdFk")
@ApiModelProperty(value = "关联业务类型ID")
private Integer relBusIdFk;
private Long relBusIdFk;
/**
*
@ -107,4 +107,4 @@ public class SysWorkplacePutRel implements Serializable {
public static final String COL_UPDATEUSER = "updateUser";
public static final String COL_REMARK = "remark";
}
}

@ -0,0 +1,34 @@
package com.glxp.api.req.basic;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
import java.util.List;
/**
* @author : zhuzhu
* @date : 2024/8/14 18:55
* @modyified By :
*/
@Data
public class CargowWorkplaceRequest extends ListPageRequest {
private List<String> documentTypeCodes;
private Long workPlaceCode;
private String code;
private String busKey;
private String workKey;
private String documentTypeCode;
private Integer isPopular;
private List<Long> workPlaceCodes;
private List<Long> collectWorkCodes;
private List<String> collectBusTypes;
private List<Long> relBusIdFks;
}

@ -20,6 +20,7 @@ public class WorkBindBusTypeRequest extends ListPageRequest {
private String workKey;
private String documentTypeCode;
private Integer isPopular;
private Integer workPlaceClass;
private List<Long> workPlaceCodes;

@ -126,6 +126,7 @@ public class SysWorkplaceDocumentResponse {
private String innerBusName;
private String outBusName;
private String workplaceName;
private String thrBusName;
private Integer autoTag;

@ -0,0 +1,18 @@
package com.glxp.api.res.basic;
import lombok.Data;
/**
* @author : zhangsan
* @date : 2024/9/27 20:40
* @modyified By :
*/
@Data
public class SysWorkplacePutRelResponse {
private String collectName;
private String busTypeName;
private Long collectWorkPlaceCode;
private String collectBusTypeCode;
}

@ -1,17 +1,31 @@
package com.glxp.api.service.thrsys;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.collect.SysWorkplacePutRelMapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.dao.basic.SysWorkplacePutRelMapper;
import com.glxp.api.entity.basic.SysWorkplacePutRel;
import com.glxp.api.req.basic.CargowWorkplaceRequest;
import com.glxp.api.res.basic.SysWorkplacePutRelResponse;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@Service
public class SysWorkplacePutRelService extends ServiceImpl<SysWorkplacePutRelMapper, SysWorkplacePutRel> {
@Resource
private SysWorkplacePutRelMapper sysWorkplacePutRelMapper;
public SysWorkplacePutRel findPutWorkPlace(Long workPlaceCode, String busType) {
List<SysWorkplacePutRel> sysWorkplacePutRelList = list(new LambdaQueryWrapper<SysWorkplacePutRel>().eq(SysWorkplacePutRel::getCollectWorkCode, workPlaceCode).eq(SysWorkplacePutRel::getCollectBusType, busType));
if (CollUtil.isNotEmpty(sysWorkplacePutRelList))
@ -25,4 +39,42 @@ public class SysWorkplacePutRelService extends ServiceImpl<SysWorkplacePutRelMap
);
}
public BaseResponse bindCollect(CargowWorkplaceRequest request, Long userId) {
for (int i = 0; i < request.getCollectWorkCodes().size(); i++) {
SysWorkplacePutRel sysWorkplacePutRel = sysWorkplacePutRelMapper.selectOne(new LambdaQueryWrapper<SysWorkplacePutRel>()
.eq(SysWorkplacePutRel::getWorkPlaceCode, request.getWorkPlaceCode())
.eq(SysWorkplacePutRel::getCollectWorkCode, request.getCollectWorkCodes().get(i))
.eq(SysWorkplacePutRel::getCollectBusType, request.getCollectBusTypes().get(i)));
if (sysWorkplacePutRel != null){
return ResultVOUtils.error(500,"当前上货工位已绑定该采集工位");
}
//开始绑定
SysWorkplacePutRel sysWorkplacePutRel1 = new SysWorkplacePutRel();
sysWorkplacePutRel1.setCollectWorkCode(request.getCollectWorkCodes().get(i));
sysWorkplacePutRel1.setCollectBusType(request.getCollectBusTypes().get(i));
sysWorkplacePutRel1.setWorkPlaceCode(request.getWorkPlaceCode());
sysWorkplacePutRel1.setRelBusIdFk(request.getRelBusIdFks().get(i));
sysWorkplacePutRel1.setId(IdUtil.getSnowflakeNextId());
sysWorkplacePutRel1.setUpdateTime(new Date());
sysWorkplacePutRel1.setCreateTime(new Date());
sysWorkplacePutRel1.setCreateUser(userId + "");
sysWorkplacePutRel1.setUpdateUser(userId + "");
int insert = sysWorkplacePutRelMapper.insert(sysWorkplacePutRel1);
if (insert == 0){
return ResultVOUtils.error(500,"选入错误");
}
}
return ResultVOUtils.success("选入成功");
}
public List<SysWorkplacePutRelResponse> filterList(CargowWorkplaceRequest request) {
if (null == request) {
return Collections.emptyList();
}
if (null != request.getPage() && null != request.getLimit()) {
PageHelper.offsetPage((request.getPage() - 1) * request.getLimit(), request.getLimit());
}
return super.baseMapper.filterList(request);
}
}

@ -31,12 +31,12 @@
</select>
<select id="filterListByWorkplace" resultType="com.glxp.api.res.basic.SysWorkplaceDocumentResponse">
select sys_workplace_document.*,sys_workplace_bus.workplaceCode,
select sys_workplace_document.*,sys_workplace_bus.workplaceCode,sys_workplace.workplaceName as workplaceName,
basic_bussiness_type.name innerBusName,
thr_bustype_origin.name outBusName
from sys_workplace_bus
LEFT JOIN sys_workplace_document
ON sys_workplace_document.documentTypeCode = sys_workplace_bus.busTypeCode
LEFT JOIN sys_workplace_document ON sys_workplace_document.documentTypeCode = sys_workplace_bus.busTypeCode
LEFT JOIN sys_workplace ON sys_workplace.workplaceId = sys_workplace_bus.workplaceCode
left join basic_bussiness_type on sys_workplace_document.documentTypeCode = basic_bussiness_type.action
left join thr_bustype_origin on thr_bustype_origin.action = sys_workplace_document.documentTypeCode
@ -44,6 +44,9 @@
<if test="workplaceCode != '' and workplaceCode != null">
AND sys_workplace_bus.workplaceCode = #{workplaceCode}
</if>
<if test="workPlaceClass != '' and workPlaceClass != null">
AND sys_workplace.workPlaceClass = #{workPlaceClass}
</if>
<if test="workPlaceCodes != null and workPlaceCodes.size() > 0">
and sys_workplace_bus.workplaceCode in

@ -0,0 +1,15 @@
<?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.glxp.api.dao.basic.SysWorkplacePutRelMapper">
<select id="filterList" resultType="com.glxp.api.res.basic.SysWorkplacePutRelResponse">
select sw.workplaceName as collectName,swd.busName as busTypeName,sw.workplaceId as collectWorkPlaceCode,swd.documentTypeCode as collectBusTypeCode
from sys_workplace_put_rel swpr
left join sys_workplace sw on swpr.collectWorkCode = sw.workplaceId
left join sys_workplace_document swd on swpr.collectBusType = swd.documentTypeCode
<where>
<if test="workPlaceCode != '' and workPlaceCode != null">
AND swpr.workPlaceCode =#{workPlaceCode}
</if>
</where>
</select>
</mapper>

@ -1,4 +0,0 @@
<?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.glxp.api.dao.basic.SysWorkplacePutRelMapper">
</mapper>
Loading…
Cancel
Save