修改预验收,寄售其他仓库用户可查看,修复修改角色bug,修复按单摆货bug

master
anthonywj 2 years ago
parent c6e36d0a79
commit 6322a3bd03

@ -24,6 +24,8 @@ import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import com.glxp.api.service.auth.*;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.BeanCopyUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -33,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.*;
import java.util.stream.Collectors;
@RestController
public class InvWarehouseController extends BaseController {
@ -118,6 +121,38 @@ public class InvWarehouseController extends BaseController {
return ResultVOUtils.success(list);
}
/**
*
*
* @return
*/
@GetMapping("spms/inv/warehouse/findAllInvByUser")
public BaseResponse findAllInvByUser(FilterInvWarehouseRequest filterInvWarehouseRequest) {
Long userId = getUserId();
List<InvWarehouseEntity> list = new ArrayList<>();
if (null == userId) {
return ResultVOUtils.error(ResultEnum.LOGIN_VERIFY_FALL);
}
if (filterInvWarehouseRequest.getAdvanceType() == 2 || filterInvWarehouseRequest.getAdvanceType() == 3) {
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
BeanUtils.copyProperties(filterInvWarehouseRequest, filterInvSubWarehouseRequest);
list = invWarehouseService.filterInvSubWarehouse(filterInvSubWarehouseRequest);
} else {
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
filterInvSubWarehouseRequest.setFilterAdvanceType(1);
List<InvWarehouseEntity> preInList = invWarehouseService.filterInvSubWarehouse(filterInvSubWarehouseRequest);
filterInvWarehouseRequest.setUserId(userId);
List<InvWarehouseEntity> myList = invWarehouseService.findInvListByUser(filterInvWarehouseRequest);
List<InvWarehouseEntity> resultList = myList.stream().filter(invWarehouseEntity ->
preInList.stream().anyMatch(preIn -> !preIn.getCode().equals(invWarehouseEntity.getCode()))
).collect(Collectors.toList());
resultList.addAll(preInList);
return ResultVOUtils.success(list);
}
return ResultVOUtils.success(list);
}
/**
* ()
*

@ -71,24 +71,24 @@ public class SysUserController extends BaseController {
AuthAdminResponse authAdminResponse = new AuthAdminResponse();
BeanUtils.copyProperties(item, authAdminResponse);
List<Long> roles = sysRoleService.selectRoleListByUserId(authAdminResponse.getId());
List<DeptUserResponse> deptUserResponses=null;
if("key".equals(filterAuthUserRequest.getKey())){
deptUserResponses = deptUserService.selectByUserIdKey(authAdminResponse.getId());
}else{
List<DeptUserResponse> deptUserResponses = null;
if ("key".equals(filterAuthUserRequest.getKey())) {
deptUserResponses = deptUserService.selectByUserIdKey(authAdminResponse.getId());
} else {
deptUserResponses = deptUserService.selectByUserId(authAdminResponse.getId());
}
if (CollUtil.isNotEmpty(deptUserResponses)) {
List<Long> depts = new ArrayList<>();
String deptName = "";
for (DeptUserResponse deptUserResponse : deptUserResponses) {
if(deptUserResponse.getDeptId()!=1){
if (deptUserResponse.getDeptId() != 1) {
depts.add(deptUserResponse.getDeptId());
deptName = deptName + "," + deptUserResponse.getDeptName();
}
}
if(deptName.length()!=0){
if (deptName.length() != 0) {
authAdminResponse.setDeptName(deptName.substring(1));
}else{
} else {
authAdminResponse.setDeptName(deptName);
}
authAdminResponse.setDepts(depts);
@ -190,9 +190,9 @@ public class SysUserController extends BaseController {
}
//默认插入第一部门
List<Long> deptCodeList=authUserSaveRequest.getDepts();
if(deptCodeList == null){
deptCodeList=new ArrayList<>();
List<Long> deptCodeList = authUserSaveRequest.getDepts();
if (deptCodeList == null) {
deptCodeList = new ArrayList<>();
}
deptCodeList.add(1L);
authUserSaveRequest.setDepts(deptCodeList);
@ -261,7 +261,7 @@ public class SysUserController extends BaseController {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
// 修改角色
// userService.insertUserAuth(authAdmin.getId(), authUserSaveRequest.getRoles());
userService.insertUserAuth(authAdmin.getId(), authUserSaveRequest.getRoles());
userService.updateAuthAdmin(authAdmin);
@ -270,19 +270,19 @@ public class SysUserController extends BaseController {
FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust();
filterDeptUserReqeust.setUserId(authUserSaveRequest.getId());
List<DeptUserEntity> deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust);
if(deptUserEntities == null){
if (deptUserEntities == null) {
deptCodeList.add(1L);
authUserSaveRequest.setDepts(deptCodeList);
}else{
Boolean checkDeptId=false;
} else {
Boolean checkDeptId = false;
for (DeptUserEntity deptUserEntity : deptUserEntities) {
if(deptUserEntity.getDeptId() == 1){
checkDeptId=true;
}else{
if (deptUserEntity.getDeptId() == 1) {
checkDeptId = true;
} else {
deptCodeList.add(deptUserEntity.getDeptId());
}
}
if(checkDeptId==false){
if (checkDeptId == false) {
deptCodeList.add(1L);
authUserSaveRequest.setDepts(deptCodeList);
}

@ -6,6 +6,7 @@ import com.glxp.api.req.inv.FilterInvPlaceRequest;
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
import com.glxp.api.req.inv.FilterInvPreinProductRequest;
import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.res.inout.IoOrderResponse;
import com.glxp.api.res.inv.InvPlaceDetailResponse;
import com.glxp.api.res.inv.InvPreinProductResponse;
import org.apache.ibatis.annotations.Mapper;
@ -41,4 +42,6 @@ public interface InvPreInProductDetailDao extends BaseMapperPlus<InvPreInProduct
void batchBindSpace(@Param("ids") List<Integer> ids, @Param("invSpaceCode") String invSpaceCode);
List<IoOrderResponse> getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest);
}

@ -6,6 +6,7 @@ import com.glxp.api.req.inv.FilterInvPlaceRequest;
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
import com.glxp.api.req.inv.FilterInvPreinProductRequest;
import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.res.inout.IoOrderResponse;
import com.glxp.api.res.inv.InvPlaceDetailResponse;
import com.glxp.api.res.inv.InvPreinProductResponse;
import org.apache.ibatis.annotations.Param;
@ -40,4 +41,6 @@ public interface InvPreProductDetailDao extends BaseMapperPlus<InvPreProductDeta
void batchBindSpace(@Param("ids") List<Integer> ids, @Param("invSpaceCode") String invSpaceCode);
List<IoOrderResponse> getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest);
}

@ -20,4 +20,5 @@ public class FilterInvSubWarehouseRequest extends ListPageRequest {
public String thirdId4;
private String key;
private Integer filterAdvanceType;
}

@ -14,6 +14,7 @@ public class FilterInvWarehouseRequest extends ListPageRequest {
private String code;
private String name;
private String deptCode;
// 1:入账库2预验收库3寄售库
private Integer advanceType;
private Boolean isDefault;
private Date updateTime;

@ -21,7 +21,6 @@ public interface InvWarehouseService extends IService<InvWarehouseEntity> {
InvWarehouseEntity selectByThrCode(String code, String thirdSys);
List<InvWarehouseEntity> filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest);
List<InvWarehouseEntity> filterGroupInvSub(FilterInvWarehouseRequest filterInvSubWarehouseRequest);

@ -1,5 +1,6 @@
package com.glxp.api.service.inv.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -92,6 +93,8 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
invInnerOrderPrintDao.delete(ew);
List<InnerOrderDetailEntity> innerOrderDetailEntityList = innerOrderDetailService.selectOrderList(orderIdFk);
if (CollUtil.isEmpty(innerOrderDetailEntityList))
return false;
for (InnerOrderDetailEntity obj : innerOrderDetailEntityList) {
InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity();

@ -176,6 +176,16 @@ public class InvPlaceServiceImpl implements InvPlaceService {
if (null != filterInvPlaceRequest.getPage() && null != filterInvPlaceRequest.getLimit()) {
PageHelper.offsetPage((filterInvPlaceRequest.getPage() - 1) * filterInvPlaceRequest.getLimit(), filterInvPlaceRequest.getLimit());
}
return invProductDetailDao.getInvPlaceOrderList(filterInvPlaceRequest);
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOne(new QueryWrapper<InvWarehouseEntity>().eq("code", filterInvPlaceRequest.getInvCode()));
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
return invPreInProductDetailDao.getInvPlaceOrderList(filterInvPlaceRequest);
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) {
return invPreProductDetailDao.getInvPlaceOrderList(filterInvPlaceRequest);
} else
return invProductDetailDao.getInvPlaceOrderList(filterInvPlaceRequest);
}
}

@ -19,6 +19,9 @@
<if test="advanceType != null">
AND a.advanceType = #{advanceType}
</if>
<if test="filterAdvanceType != null">
AND (a.advanceType = 2 or advanceType = 3)
</if>
<if test="parentId != '' and parentId != null">
AND a.parentId = #{parentId}
</if>
@ -147,7 +150,7 @@
replace
INTO auth_warehouse
( id, code, `name`, parentId, remark, defaultInv, advanceType, spUse, parentCode
, thirdId, thirdId1, thirdId2, thirdId3, thirdId4)
, thirdId, thirdId1, thirdId2, thirdId3, thirdId4, updateTime)
values (#{id},
#{code},
#{name},
@ -161,7 +164,7 @@
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4})
#{thirdId4}, #{updateTime})
</insert>
@ -220,6 +223,9 @@
<if test="spUse != null">
spUse=#{spUse},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
</trim>
WHERE id = #{id}
</update>
@ -229,7 +235,7 @@
into auth_warehouse
(id, code, `name`, parentId, remark, defaultInv, parentCode, advanceType, thirdId, thirdId1, thirdId2,
thirdId3,
thirdId4)
thirdId4, updateTime)
values
@ -246,7 +252,7 @@
#{item.thirdId1},
#{item.thirdId2},
#{item.thirdId3},
#{item.thirdId4})
#{item.thirdId4}, {item.updateTime})
</foreach>
</insert>

@ -197,4 +197,28 @@
#{item}
</foreach>
</update>
<select id="getInvPlaceOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse">
select ipd.orderId billNo,
(select name from basic_bussiness_type where action = o.action) billTypeName,
o.mainAction,
o.fromCorp,
o.corpOrderId,
o.fromType,
o.createTime,
o.auditTime,
(select employeeName from auth_user where id = o.reviewUser) reviewUserName
from inv_prein_product_detail ipd
left join io_order o on ipd.orderId = o.billNo
<where>
<if test="invCode != null and invCode != ''">
AND ipd.invCode = #{invCode}
</if>
<if test="orderId != null and orderId != ''">
AND ipd.orderId like concat('%', #{orderId}, '%')
</if>
</where>
group by ipd.orderId
</select>
</mapper>

@ -197,4 +197,28 @@
#{item}
</foreach>
</update>
<select id="getInvPlaceOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse">
select ipd.orderId billNo,
(select name from basic_bussiness_type where action = o.action) billTypeName,
o.mainAction,
o.fromCorp,
o.corpOrderId,
o.fromType,
o.createTime,
o.auditTime,
(select employeeName from auth_user where id = o.reviewUser) reviewUserName
from inv_pre_product_detail ipd
left join io_order o on ipd.orderId = o.billNo
<where>
<if test="invCode != null and invCode != ''">
AND ipd.invCode = #{invCode}
</if>
<if test="orderId != null and orderId != ''">
AND ipd.orderId like concat('%', #{orderId}, '%')
</if>
</where>
group by ipd.orderId
</select>
</mapper>

Loading…
Cancel
Save