x新增委托验收功能
parent
731c62c1d2
commit
660f20101a
@ -0,0 +1,112 @@
|
||||
package com.glxp.api.admin.controller.basic;
|
||||
//委托验收
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.admin.entity.basic.BussinessTypeEntity;
|
||||
import com.glxp.api.admin.entity.basic.DlEntrustReceEntity;
|
||||
import com.glxp.api.admin.entity.basic.EntrustReceEntity;
|
||||
import com.glxp.api.admin.req.basic.BasicEntrustRecRequest;
|
||||
import com.glxp.api.admin.req.inout.DeleteRequest;
|
||||
import com.glxp.api.admin.req.receipt.BussinessTypeFilterRequest;
|
||||
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||
import com.glxp.api.admin.res.basic.EntrustReceRespose;
|
||||
import com.glxp.api.admin.service.auth.CustomerService;
|
||||
import com.glxp.api.admin.service.basic.BussinessTypeService;
|
||||
import com.glxp.api.admin.service.basic.EntrustReceService;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class EntrustReceController {
|
||||
|
||||
|
||||
@Resource
|
||||
EntrustReceService entrustReceService;
|
||||
@Resource
|
||||
CustomerService customerService;
|
||||
@Resource
|
||||
private BussinessTypeService bussinessTypeService;
|
||||
|
||||
@GetMapping("/spms/entrust/rece/filter")
|
||||
public BaseResponse getEntrustRece(BasicEntrustRecRequest basicExportStatusRequest) {
|
||||
List<EntrustReceRespose> entrustReceEntities = entrustReceService.filterJoinEntrustRec(basicExportStatusRequest);
|
||||
PageInfo<EntrustReceRespose> pageInfo;
|
||||
pageInfo = new PageInfo<>(entrustReceEntities);
|
||||
PageSimpleResponse<EntrustReceRespose> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(entrustReceEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
//手持终端下载委托验收
|
||||
@GetMapping("/spms/entrust/rece/downloads")
|
||||
public BaseResponse downloadEntrust(BasicEntrustRecRequest basicExportStatusRequest) {
|
||||
Integer userId = customerService.getUserId();
|
||||
basicExportStatusRequest.setEntrustUser(userId + "");
|
||||
List<DlEntrustReceEntity> entrustReceEntities = entrustReceService.downloadEntrustRec(basicExportStatusRequest);
|
||||
PageInfo<DlEntrustReceEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(entrustReceEntities);
|
||||
PageSimpleResponse<DlEntrustReceEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(entrustReceEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/spms/entrust/rece/filterAllNoUse")
|
||||
public BaseResponse filterAllNoUse(BasicEntrustRecRequest basicExportStatusRequest) {
|
||||
Integer uerId = customerService.getUserId();
|
||||
BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest();
|
||||
bussinessTypeFilterRequest.setUserId(uerId);
|
||||
List<BussinessTypeEntity> bussinessTypeEntities = bussinessTypeService.filterAllByUser(bussinessTypeFilterRequest);
|
||||
return ResultVOUtils.success(bussinessTypeEntities);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/spms/entrust/rece/add")
|
||||
public BaseResponse aadEntrustRece(@RequestBody EntrustReceEntity entrustReceEntity) {
|
||||
Integer userId = customerService.getUserId();
|
||||
entrustReceEntity.setUserId(userId + "");
|
||||
entrustReceEntity.setUpdateTime(new Date());
|
||||
boolean b = entrustReceService.insertEntrustRec(entrustReceEntity);
|
||||
if (b) {
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
} else {
|
||||
return ResultVOUtils.error(500, "添加失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/spms/entrust/rece/update")
|
||||
public BaseResponse updateEntrustRece(@RequestBody EntrustReceEntity entrustReceEntity) {
|
||||
boolean b = entrustReceService.updateEntrustRec(entrustReceEntity);
|
||||
if (b) {
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
} else {
|
||||
return ResultVOUtils.error(500, "添加失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/spms/entrust/rece/delete")
|
||||
public BaseResponse deleteByStatus(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
boolean b = entrustReceService.deleteById(deleteRequest.getId());
|
||||
if (b)
|
||||
return ResultVOUtils.success("删除成功!");
|
||||
else
|
||||
return ResultVOUtils.error(500, "删除失败!");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.glxp.api.admin.dao.basic;
|
||||
|
||||
import com.glxp.api.admin.entity.basic.DlEntrustReceEntity;
|
||||
import com.glxp.api.admin.entity.basic.EntrustReceEntity;
|
||||
import com.glxp.api.admin.req.basic.BasicEntrustRecRequest;
|
||||
import com.glxp.api.admin.res.basic.EntrustReceRespose;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface EntrustReceDao {
|
||||
|
||||
|
||||
List<EntrustReceEntity> filterEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);
|
||||
|
||||
List<DlEntrustReceEntity> downloadEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);
|
||||
|
||||
|
||||
List<EntrustReceRespose> filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);
|
||||
|
||||
boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean updateEntrustRec(EntrustReceEntity warehouseEntity);
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.glxp.api.admin.entity.basic;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DlEntrustReceEntity {
|
||||
|
||||
|
||||
private Integer id;
|
||||
private String action;
|
||||
private String name;
|
||||
private String mainAction;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.glxp.api.admin.entity.basic;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class EntrustReceEntity {
|
||||
|
||||
private Integer id;
|
||||
private String action;
|
||||
private String curInv;
|
||||
private String entrustInv;
|
||||
private String entrustUser;
|
||||
private String userId;
|
||||
private String entrustAction;
|
||||
private Date updateTime;
|
||||
private String remark;
|
||||
private boolean finishRece;
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.glxp.api.admin.req.basic;
|
||||
|
||||
import com.glxp.api.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class BasicEntrustRecRequest extends ListPageRequest {
|
||||
|
||||
private Integer id;
|
||||
private String action;
|
||||
private String entrustInv;
|
||||
private String entrustUser;
|
||||
private String userId;
|
||||
private Date updateTime;
|
||||
private String curInv;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.glxp.api.admin.res.basic;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class EntrustReceRespose {
|
||||
private Integer id;
|
||||
private String action;
|
||||
private String entrustInv;
|
||||
private String entrustUser;
|
||||
private String userId;
|
||||
private String entrustAction;
|
||||
private Date updateTime;
|
||||
private String remark;
|
||||
private boolean finishRece;
|
||||
private String curName;
|
||||
private String entrustName;
|
||||
private String employeeName;
|
||||
private String entrustInvName;
|
||||
private String curInv;
|
||||
private String curInvName;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.glxp.api.admin.service.basic;
|
||||
|
||||
|
||||
import com.glxp.api.admin.entity.basic.DlEntrustReceEntity;
|
||||
import com.glxp.api.admin.entity.basic.EntrustReceEntity;
|
||||
import com.glxp.api.admin.req.basic.BasicEntrustRecRequest;
|
||||
import com.glxp.api.admin.res.basic.EntrustReceRespose;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EntrustReceService {
|
||||
|
||||
EntrustReceEntity findById(Integer id);
|
||||
|
||||
List<EntrustReceEntity> filterEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);
|
||||
|
||||
List<DlEntrustReceEntity> downloadEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);
|
||||
|
||||
List<EntrustReceRespose> filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);
|
||||
|
||||
boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean updateEntrustRec(EntrustReceEntity warehouseEntity);
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package com.glxp.api.admin.service.basic.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.admin.dao.basic.EntrustReceDao;
|
||||
import com.glxp.api.admin.entity.basic.DlEntrustReceEntity;
|
||||
import com.glxp.api.admin.entity.basic.EntrustReceEntity;
|
||||
import com.glxp.api.admin.req.basic.BasicEntrustRecRequest;
|
||||
import com.glxp.api.admin.res.basic.EntrustReceRespose;
|
||||
import com.glxp.api.admin.service.basic.EntrustReceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class EntrustReceServiceImpl implements EntrustReceService {
|
||||
|
||||
@Resource
|
||||
EntrustReceDao entrustReceDao;
|
||||
|
||||
@Override
|
||||
public EntrustReceEntity findById(Integer id) {
|
||||
BasicEntrustRecRequest basicEntrustRecRequest = new BasicEntrustRecRequest();
|
||||
basicEntrustRecRequest.setId(id);
|
||||
List<EntrustReceEntity> entrustReceEntities = entrustReceDao.filterEntrustRec(basicEntrustRecRequest);
|
||||
if (CollUtil.isNotEmpty(entrustReceEntities)) {
|
||||
return entrustReceEntities.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntrustReceEntity> filterEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest) {
|
||||
|
||||
if (basicEntrustRecRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (basicEntrustRecRequest.getPage() != null) {
|
||||
int offset = (basicEntrustRecRequest.getPage() - 1) * basicEntrustRecRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, basicEntrustRecRequest.getLimit());
|
||||
}
|
||||
return entrustReceDao.filterEntrustRec(basicEntrustRecRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DlEntrustReceEntity> downloadEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest) {
|
||||
if (basicEntrustRecRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (basicEntrustRecRequest.getPage() != null) {
|
||||
int offset = (basicEntrustRecRequest.getPage() - 1) * basicEntrustRecRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, basicEntrustRecRequest.getLimit());
|
||||
}
|
||||
return entrustReceDao.downloadEntrustRec(basicEntrustRecRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntrustReceRespose> filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest) {
|
||||
|
||||
if (basicEntrustRecRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (basicEntrustRecRequest.getPage() != null) {
|
||||
int offset = (basicEntrustRecRequest.getPage() - 1) * basicEntrustRecRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, basicEntrustRecRequest.getLimit());
|
||||
}
|
||||
return entrustReceDao.filterJoinEntrustRec(basicEntrustRecRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertEntrustRec(EntrustReceEntity entrustReceEntity) {
|
||||
return entrustReceDao.insertEntrustRec(entrustReceEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return entrustReceDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateEntrustRec(EntrustReceEntity entrustReceEntity) {
|
||||
return entrustReceDao.updateEntrustRec(entrustReceEntity);
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
<?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.admin.dao.basic.EntrustReceDao">
|
||||
|
||||
<select id="filterEntrustRec" parameterType="com.glxp.api.admin.req.basic.BasicEntrustRecRequest"
|
||||
resultType="com.glxp.api.admin.entity.basic.EntrustReceEntity">
|
||||
select * from basic_entrust_accept
|
||||
<where>
|
||||
<if test="id != '' and id!=null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="action!=null">
|
||||
and action = #{action}
|
||||
</if>
|
||||
<if test="entrustInv!=null">
|
||||
and entrustInv = #{entrustInv}
|
||||
</if>
|
||||
<if test="entrustUser != '' and entrustUser!=null">
|
||||
and entrustUser = #{entrustUser}
|
||||
</if>
|
||||
<if test="userId!=null">
|
||||
and userId = #{userId}
|
||||
</if>
|
||||
<if test="curInv!=null">
|
||||
and curInv = #{curInv}
|
||||
</if>
|
||||
</where>
|
||||
order by updateTime desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="downloadEntrustRec" parameterType="com.glxp.api.admin.req.basic.BasicEntrustRecRequest"
|
||||
resultType="com.glxp.api.admin.entity.basic.DlEntrustReceEntity">
|
||||
select
|
||||
basic_entrust_accept.id,b.name,b.action,b.mainAction
|
||||
from basic_entrust_accept
|
||||
INNER JOIN basic_bustype_local a on basic_entrust_accept.action = a.action
|
||||
INNER JOIN basic_bussiness_type b on a.action = b.localAction
|
||||
LEFT JOIN auth_user on basic_entrust_accept.entrustUser = auth_user.id
|
||||
<where>
|
||||
<if test="id != '' and id!=null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="action!=null">
|
||||
and basic_entrust_accept.action = #{action}
|
||||
</if>
|
||||
<if test="entrustInv!=null">
|
||||
and basic_entrust_accept.entrustInv = #{entrustInv}
|
||||
</if>
|
||||
<if test="entrustUser != '' and entrustUser!=null">
|
||||
and basic_entrust_accept.entrustUser = #{entrustUser}
|
||||
</if>
|
||||
<if test="userId!=null">
|
||||
and basic_entrust_accept.userId = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="filterJoinEntrustRec" parameterType="com.glxp.api.admin.req.basic.BasicEntrustRecRequest"
|
||||
resultType="com.glxp.api.admin.res.basic.EntrustReceRespose">
|
||||
select basic_entrust_accept.* ,
|
||||
a.name curName, b.name entrustName,auth_user.employeeName
|
||||
,c.name entrustInvName,d.name curInvName
|
||||
from basic_entrust_accept
|
||||
LEFT JOIN basic_bustype_local a on basic_entrust_accept.action = a.action
|
||||
LEFT JOIN basic_bussiness_type b on basic_entrust_accept.entrustAction = b.action
|
||||
LEFT JOIN auth_user on basic_entrust_accept.entrustUser = auth_user.id
|
||||
LEFT JOIN inv_warehouse c on basic_entrust_accept.entrustInv = c.`code`
|
||||
LEFT JOIN inv_warehouse d on basic_entrust_accept.curInv = d.`code`
|
||||
<where>
|
||||
<if test="id != '' and id!=null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="action!=null">
|
||||
and action = #{action}
|
||||
</if>
|
||||
<if test="entrustInv!=null">
|
||||
and entrustInv = #{entrustInv}
|
||||
</if>
|
||||
<if test="entrustUser != '' and entrustUser!=null">
|
||||
and entrustUser = #{entrustUser}
|
||||
</if>
|
||||
<if test="userId!=null">
|
||||
and userId = #{userId}
|
||||
</if>
|
||||
<if test="curInv!=null">
|
||||
and curInv = #{curInv}
|
||||
</if>
|
||||
</where>
|
||||
order by updateTime desc
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertEntrustRec" keyProperty="id"
|
||||
parameterType="com.glxp.api.admin.entity.basic.EntrustReceEntity">
|
||||
replace
|
||||
INTO basic_entrust_accept(id,`action`, entrustInv, `entrustUser`, userId, updateTime, remark,entrustAction,finishRece,curInv)
|
||||
values (
|
||||
#{id},
|
||||
#{action},
|
||||
#{entrustInv},
|
||||
#{entrustUser},
|
||||
#{userId},
|
||||
#{updateTime},
|
||||
#{remark},
|
||||
#{entrustAction},
|
||||
#{finishRece},
|
||||
#{curInv}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateEntrustRec" parameterType="com.glxp.api.admin.entity.basic.EntrustReceEntity">
|
||||
UPDATE basic_entrust_accept
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="action != null">action=#{action},</if>
|
||||
<if test="entrustInv != null">entrustInv=#{entrustInv},</if>
|
||||
<if test="entrustUser != null">entrustUser=#{entrustUser},</if>
|
||||
<if test="userId != null">userId=#{userId},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="curInv != null">curInv=#{curInv},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="finishRece != null">finishRece=#{finishRece},</if>
|
||||
<if test="entrustAction != null">entrustAction=#{entrustAction},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM basic_entrust_accept
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue