代码迁移备份,预验收退回修改

master
anthonywj 2 years ago
parent a1088a5170
commit a8504f276e

@ -3,6 +3,9 @@ package com.glxp.api.constant;
public class Constant {
public static String SYSTEM_CUSTOMER_ID = "110";
public static final String INV_PRE_IN_CODE = "1000001";//默认预验收仓库号
public static final String INV_PRE_CODE = "1000002";//默认寄售仓库号
public static String MUTI = "MUTI";
public static final String SERIAL_CACHE_PREFIX = "serial_";
@ -263,5 +266,6 @@ public class Constant {
public static final String ORDER_ACTION_SUP_INVOICE = "supInvoice";
public static final String ORDER_ACTION_SUP_DELAUDIT = "supDelAudit";
public static final String ORDER_ACTION_SUP_INOUT = "supInout";
public static final String ORDER_ACTION_SUP_PREIN = "preInOrder";
}

@ -274,17 +274,16 @@ public class InvWarehouseController extends BaseController {
//更新仓库信息
invWarehouseEntity.setUpdateTime(new Date());
boolean b = invWarehouseService.updateInvSubWarehouse(invWarehouseEntity);
//如果要是一级仓库就吧全部子集都刷成一样的寄售仓库
if(StrUtil.isBlank(invWarehouseEntity.getParentCode())){
List<InvWarehouseEntity> invWarehouseEntityList=invWarehouseService.selectLowWarehouseAll(invWarehouseEntity.getCode());
for (InvWarehouseEntity obj : invWarehouseEntityList) {
obj.setAdvanceType(invWarehouseEntity.getAdvanceType());
obj.setUpdateTime(new Date());
invWarehouseService.updateInvSubWarehouse(obj);
}
}
//
// //如果要是一级仓库就吧全部子集都刷成一样的寄售仓库
// if(StrUtil.isBlank(invWarehouseEntity.getParentCode())){
// List<InvWarehouseEntity> invWarehouseEntityList=invWarehouseService.selectLowWarehouseAll(invWarehouseEntity.getCode());
// for (InvWarehouseEntity obj : invWarehouseEntityList) {
// obj.setAdvanceType(invWarehouseEntity.getAdvanceType());
// obj.setUpdateTime(new Date());
// invWarehouseService.updateInvSubWarehouse(obj);
// }
// }
//更新部门信息
@ -640,8 +639,9 @@ public class InvWarehouseController extends BaseController {
@PostMapping("/warehouse/inout/getDeptById")
public BaseResponse getDeptById(@RequestBody List<Integer> deptIds) {
List<DeptEntity> list = deptService.getDeptById(deptIds);
return ResultVOUtils.success(list);
// List<DeptEntity> list = deptService.getDeptById(deptIds);
// return ResultVOUtils.success(list);
return null;
}
}

@ -392,9 +392,9 @@ public class BasicBussinessTypeController extends BaseController {
@GetMapping("/udiwms/busType/selectList")
public BaseResponse selectList() {
FilterBussinessTypeRequest bussinessTypeFilterRequest=new FilterBussinessTypeRequest();
bussinessTypeFilterRequest.setAction("2");
bussinessTypeFilterRequest.setMainAction("WareHouseOut");
FilterBussinessTypeRequest bussinessTypeFilterRequest = new FilterBussinessTypeRequest();
bussinessTypeFilterRequest.setActionType(2);
bussinessTypeFilterRequest.setMainAction(ConstantType.TYPE_OUT);
bussinessTypeFilterRequest.setCorpType(2);
List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeService.findList(bussinessTypeFilterRequest);
return ResultVOUtils.success(bussinessTypeEntities);

@ -11,6 +11,7 @@ import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.inout.IoCodeLostEntity;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.req.inout.IoCodeLostRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inout.IoCodeLostResponse;
import com.glxp.api.service.inout.IoCodeLostService;
@ -34,13 +35,13 @@ public class IoCodeLostController extends BaseController {
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/getCodeLost")
public BaseResponse getCodeLost(@RequestBody @Valid IoCodeLostEntity ioCodeLostEntity, BindingResult bindingResult) {
public BaseResponse getCodeLost(@RequestBody @Valid IoCodeLostRequest ioCodeLostEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<IoCodeLostResponse> list = codeLostService.selectLost(ioCodeLostEntity);
PageInfo<IoCodeLostResponse> pageInfo;
pageInfo= new PageInfo<>(list);
pageInfo = new PageInfo<>(list);
PageSimpleResponse<IoCodeLostResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);

@ -428,7 +428,7 @@ public class IoCodeTempController extends BaseController {
//过期提醒:
// SystemParamConfigEntity expireParamConfigEntity = systemParamConfigService.selectByParamKey("expire_date_tip");
if (bussinessTypeEntity.getCheckVailDate()==1 && !addOrderRequest.isIgnoreExpire()) {
if (bussinessTypeEntity.getCheckVailDate() == 1 && !addOrderRequest.isIgnoreExpire()) {
if (StrUtil.isNotEmpty(udiEntity.getExpireDate())) {
String expireDate = "20" + udiEntity.getExpireDate();
long expireTime = DateUtil.parseDateExpire(expireDate);
@ -441,7 +441,7 @@ public class IoCodeTempController extends BaseController {
//失效期提醒
SystemParamConfigEntity recentParamConfigEntity = systemParamConfigService.selectByParamKey("recent_date_tip");
long recent = Long.parseLong(recentParamConfigEntity.getParamValue());
if (bussinessTypeEntity.getCheckVailDate()==1 && recent > 0 && !addOrderRequest.isIgnoreRecentExpire()) {
if (bussinessTypeEntity.getCheckVailDate() == 1 && recent > 0 && !addOrderRequest.isIgnoreRecentExpire()) {
if (StrUtil.isNotEmpty(udiEntity.getExpireDate())) {
String expireDate = "20" + udiEntity.getExpireDate();
long expireTime = DateUtil.parseDateExpire(expireDate);
@ -472,14 +472,13 @@ public class IoCodeTempController extends BaseController {
if (bussinessTypeEntity.isScanPreIn()) {
if (bussinessTypeEntity.getBackPreinType() == 1) {//按单出库
String orderIds = bussinessTypeEntity.getCheckPreInOrders();
String orderIds = addOrderRequest.getCheckPreInOrders();
if (StrUtil.isNotEmpty(orderIds)) {
String[] orderIdArray = StringUtils.split(",");
String[] orderIdArray = orderIds.split(",");
List<String> orderList = CollUtil.toList(orderIdArray);
int count = codeService.findByOrderIdsCount(orderList, code);
if (count <= 0) {
return ResultVOUtils.error(500, "预验收库存数量不足!");
return ResultVOUtils.error(500, "非预验收单产品或预验收库存数量不足!");
}
if (StrUtil.isNotEmpty(orderId)) {//非首次添加
if (StrUtil.isEmpty(udiEntity.getSerialNo())) {//该单据已有该产品
@ -676,6 +675,7 @@ public class IoCodeTempController extends BaseController {
orderEntity.setUpdateTime(new Date());
orderEntity.setCustomerId(authAdmin.getCustomerId() + "");
orderEntity.setDeptCode(invWarehouseEntity.getParentId());
orderEntity.setCheckPreInOrders(addOrderRequest.getCheckPreInOrders());
orderEntity.setInvCode(addOrderRequest.getInvCode());
orderEntity.setOrderType(addOrderRequest.getOrderType());
orderEntity.setBusType(bussinessTypeEntity.getBusType());

@ -103,20 +103,8 @@ public class IoOrderController extends BaseController {
public BaseResponse filterPreInorder(FilterOrderRequest filterOrderRequest) {
if (StrUtil.isNotBlank(filterOrderRequest.getStatusType())) {
orderService.setFilterStatus(filterOrderRequest);
}
if (StrUtil.isNotBlank(filterOrderRequest.getVueType())) {
orderService.setActions(filterOrderRequest);
}
if (StrUtil.isNotEmpty(filterOrderRequest.getSupInoivceSearch())) {
orderService.setInvoiceFiltes(filterOrderRequest);
}
String customerId = getCustomerId();
if (!customerId.equals("110")) {
filterOrderRequest.setFromCorp(customerId);
}
filterOrderRequest.setVueType(Constant.ORDER_ACTION_SUP_PREIN);
orderService.setActions(filterOrderRequest);
List<IoOrderResponse> list = orderService.filterList(filterOrderRequest);
PageInfo<IoOrderResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);

@ -4,9 +4,12 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
import com.glxp.api.entity.inv.InvPreProductEntity;
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
@ -38,7 +41,7 @@ import java.util.List;
*/
@Slf4j
@RestController
public class InvPreProductController {
public class InvPreProductController extends BaseController {
@Resource
private InvPreProductService invPreProductService;
@ -113,6 +116,7 @@ public class InvPreProductController {
* @return
*/
@PostMapping("/spms/inv/pre/product/delete")
@Log(title = "寄售库存", businessType = BusinessType.DELETE)
public BaseResponse deleteInvPreProduct(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());

@ -6,15 +6,20 @@ import cn.hutool.core.util.StrUtil;
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.inv.InvPreInProductDetailEntity;
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
import com.glxp.api.req.inv.FilterInvPreinDetailRequest;
import com.glxp.api.req.inv.FilterInvPreinProductRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inv.InvPreProductDetailResponse;
import com.glxp.api.res.inv.InvPreProductPageResponse;
import com.glxp.api.res.inv.InvPreinDetailResponse;
import com.glxp.api.res.inv.InvPreinProductResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.auth.WarehouseUserService;
import com.glxp.api.service.inv.InvPreinDetailService;
import com.glxp.api.service.inv.InvPreinProductDetailService;
import com.glxp.api.service.inv.InvPreinProductService;
import com.glxp.api.util.udi.FilterUdiUtils;
@ -31,7 +36,7 @@ import java.util.List;
*/
@Slf4j
@RestController
public class InvPreinProductController {
public class InvPreinProductController extends BaseController {
@Resource
private InvPreinProductDetailService invPreinProductDetailService;
@Resource

@ -2,6 +2,7 @@ package com.glxp.api.dao.inout;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inout.IoCodeLostEntity;
import com.glxp.api.req.inout.IoCodeLostRequest;
import com.glxp.api.res.inout.IoCodeLostResponse;
import org.apache.ibatis.annotations.Mapper;
@ -9,6 +10,6 @@ import java.util.List;
@Mapper
public interface IoCodeLostMapper extends BaseMapperPlus<IoCodeLostMapper, IoCodeLostEntity, IoCodeLostEntity> {
List<IoCodeLostResponse> selectLost(IoCodeLostEntity ioCodeLostEntity);
List<IoCodeLostResponse> selectLost(IoCodeLostRequest ioCodeLostRequest);
}

@ -16,4 +16,11 @@ public interface IoOrderDetailCodeDao extends BaseMapperPlus<IoOrderDetailCodeDa
* @return
*/
List<IoOrderDetailCodeResponse> filterList(FilterOrderDetailCodeRequest detailCodeRequest);
/**
*
*
* @param orderDetailCodeEntity
*/
void updateCount(IoOrderDetailCodeEntity orderDetailCodeEntity);
}

@ -4,12 +4,14 @@ import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inv.InvPreInProductDetailEntity;
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Dao
*/
@Mapper
public interface InvPreInProductDetailDao extends BaseMapperPlus<InvPreInProductDetailDao, InvPreInProductDetailEntity, InvPreInProductDetailEntity> {
/**

@ -4,12 +4,14 @@ import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inv.InvPreinProductEntity;
import com.glxp.api.req.inv.FilterInvPreinProductRequest;
import com.glxp.api.res.inv.InvPreinProductResponse;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Dao
*/
@Mapper
public interface InvPreinProductDao extends BaseMapperPlus<InvPreinProductDao, InvPreinProductEntity, InvPreinProductEntity> {
/**

@ -83,14 +83,17 @@ public class InvWarehouseEntity {
private String parentCode;
/**
*
* 1:23
*/
@TableField(value = "advanceType")
private Integer advanceType;
@TableField(value = "spUse")
private Boolean spUse;
@TableField(value = "updateTime")
private Date updateTime;
@TableField(exist = false)
public String thirdName;
@TableField(exist = false)

@ -123,7 +123,7 @@ public class BasicBusTypePreEntity {
@TableField(value = "remark")
private String remark;
// 创建单模式1送货至入库单模式2.向上级补单模式3.预验收/寄售转入库单模式
// 创建单模式1送货至入库单模式2.向上级补单模式3.预验收转入库单模式4.寄售转入库单模式
@TableField(value = "createType")
private int createType;

@ -402,8 +402,6 @@ public class BasicBussinessTypeEntity {
// 预验收剩余库存退库方式 1:按单使用或退库2按货位/仓库使用或退库
@TableField(value = "backPreinType")
private Integer backPreinType;
@TableField(value = "checkPreInOrders")
private String checkPreInOrders;
// 寄售使用禁止无库存出库
@TableField(value = "advancePreIn")
private boolean advancePreIn;

@ -233,5 +233,7 @@ public class IoOrderEntity {
private String relKey; //关联单据唯一键
@TableField(value = "suppleCount")
private Integer suppleCount; //补单次数
@TableField(value = "checkPreInOrders")
private String checkPreInOrders;
}

@ -12,7 +12,7 @@ import java.util.Date;
*
*/
@Data
@TableName(value = "inv_pre_product_detail")
@TableName(value = "inv_prein_product_detail")
public class InvPreInProductDetailEntity {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;

@ -14,7 +14,7 @@ public class FilterInvWarehouseRequest extends ListPageRequest {
private String code;
private String name;
private String deptCode;
private Boolean advanceType;
private Integer advanceType;
private Boolean isDefault;
private Date updateTime;
private Integer level;

@ -27,4 +27,5 @@ public class AddOrderRequest {
private boolean codeFillCheck;
private Integer orderType;
private String remark;
private String checkPreInOrders;
}

@ -147,6 +147,7 @@ public class FilterOrderRequest extends ListPageRequest {
* supInvoice
* norDetail
* preDetail
* preInOrder
*/
private String vueType; //页面类型

@ -0,0 +1,70 @@
package com.glxp.api.req.inout;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
import java.util.Date;
@Data
public class IoCodeLostRequest extends ListPageRequest {
private Integer id;
/**
* UDI
*/
private String code;
/**
*
*/
private String batchNo;
/**
*
*/
private String produceDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String serialNo;
/**
*
*/
private String supId;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private String remark;
private String nameCode;
private String cpmctymc;
private String ggxh;
private String startTime;
private String endTime;
}

@ -31,7 +31,7 @@ public class DeptServiceImpl implements DeptService {
public DeptEntity findDefault(Boolean advaceType, Boolean isDefault) {
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setIsDefault(isDefault);
filterInvWarehouseRequest.setAdvanceType(advaceType);
// filterInvWarehouseRequest.setAdvanceType(advaceType);
List<DeptEntity> invWarehouseEntities = deptDao.filterInvWarehouse(filterInvWarehouseRequest);
if (invWarehouseEntities != null && invWarehouseEntities.size() > 0)
return invWarehouseEntities.get(0);

@ -247,6 +247,10 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService
bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.gt("spUse", 0).eq("enable", true));
break;
case Constant.ORDER_ACTION_SUP_PREIN:
bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>()
.gt("spUse", 0).eq("enable", true).eq("corpType", ConstantStatus.CORP_TYPE_OUT).eq("actionType", 2));
default:
break;
}

@ -3,11 +3,14 @@ package com.glxp.api.service.inout;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.dao.inout.IoOrderDetailCodeDao;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.basic.UdiEntity;
@ -68,6 +71,8 @@ public class IoAddInoutService {
SystemParamConfigService systemParamConfigService;
@Resource
IoOrderDetailBizService orderDetailBizService;
@Resource
private IoOrderDetailCodeDao orderDetailCodeDao;
//新增扫码单据处理
public void dealProcess(IoOrderEntity orderEntity) {
@ -146,17 +151,21 @@ public class IoAddInoutService {
insertList.clear();
return;
}
//三期校验
String checkOriginMsg = checkOriginCode(warehouseEntity);
if (StrUtil.isNotEmpty(checkOriginMsg)) {
orderEntity.setErrMsg(checkOriginMsg);
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
insertList.clear();
return;
if (bussinessTypeEntity.isCodeFillCheck()) {
//三期校验
String checkOriginMsg = checkOriginCode(warehouseEntity);
if (StrUtil.isNotEmpty(checkOriginMsg)) {
orderEntity.setErrMsg(checkOriginMsg);
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
insertList.clear();
return;
}
}
//产品是否已维护已关联
if ((warehouseEntity.getRelId() == null)) {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
@ -296,7 +305,7 @@ public class IoAddInoutService {
//生成扫码单据详情
public void genOrderDetailCode(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity) {
List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderEntity.getBillNo());
List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntities = orderDetailCodeDao.selectList(new QueryWrapper<IoOrderDetailCodeEntity>().select("id", "count", "reCount", "bindRlFk", "batchNo").eq("orderIdFk", orderEntity.getBillNo()));
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectSupGroupById(codeTempEntity.getRelId());
// UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(codeTempEntity.getRelId());
if (CollUtil.isEmpty(ioOrderDetailCodeEntities)) {
@ -309,7 +318,10 @@ public class IoAddInoutService {
StrUtil.trimToEmpty(orderDetailCodeEntity.getBatchNo()).equals(StrUtil.trimToEmpty(codeTempEntity.getBatchNo()))) {
orderDetailCodeEntity.setCount(orderDetailCodeEntity.getCount() + codeTempEntity.getMyCount());
orderDetailCodeEntity.setReCount(orderDetailCodeEntity.getReCount() + codeTempEntity.getMyReCount());
orderDetailCodeService.update(orderDetailCodeEntity);
UpdateWrapper<IoOrderDetailCodeEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("count", orderDetailCodeEntity.getCount()).set("reCount", orderDetailCodeEntity.getReCount());
orderDetailCodeDao.updateCount(orderDetailCodeEntity);
isUpdate = true;
break;
}
@ -326,7 +338,7 @@ public class IoAddInoutService {
IoOrderEntity order = orderService.findByBillNo(orderId);
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(order.getAction());
if (StrUtil.isBlank(bussinessTypeEntity.getSupplementOrderType())) {
return ResultVOUtils.error(500,"此单据类型不可补单");
return ResultVOUtils.error(500, "此类型单据不可补单");
}
IoOrderEntity supplementOrder = new IoOrderEntity();
BeanUtil.copyProperties(order, supplementOrder);

@ -196,19 +196,17 @@ public class IoChangeInoutService {
outOrder.setFromInvCode(null);
outOrder.setFromDeptCode(null);
} else if (bussinessChangeTypeEntity.getCreateType() == 3) { //寄售、预验收补单
if (targetBustypeEntity.getActionType() == 2) {
outOrder.setCustomerId(null);
outOrder.setFromCorp(null);
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode("1000001");
outOrder.setFromInvCode(invWarehouseEntity.getCode());
outOrder.setFromDeptCode(invWarehouseEntity.getParentId());
} else if (targetBustypeEntity.getActionType() == 3) {
outOrder.setCustomerId(null);
outOrder.setFromCorp(null);
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode("1000002");
outOrder.setFromInvCode(invWarehouseEntity.getCode());
outOrder.setFromDeptCode(invWarehouseEntity.getParentId());
}
outOrder.setCustomerId(null);
outOrder.setFromCorp(null);
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(Constant.INV_PRE_IN_CODE);
outOrder.setFromInvCode(invWarehouseEntity.getCode());
outOrder.setFromDeptCode(invWarehouseEntity.getParentId());
} else if (targetBustypeEntity.getActionType() == 4) {
outOrder.setCustomerId(null);
outOrder.setFromCorp(null);
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(Constant.INV_PRE_CODE);
outOrder.setFromInvCode(invWarehouseEntity.getCode());
outOrder.setFromDeptCode(invWarehouseEntity.getParentId());
} else {
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
InvWarehouseEntity curInv = invWarehouseService.findByInvSubByCode(orderEntity.getInvCode());

@ -8,6 +8,7 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.ConstantType;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.inout.*;
@ -16,6 +17,7 @@ import com.glxp.api.entity.inv.InvPreinDetailEntity;
import com.glxp.api.res.inout.IoOrderCheckResultResponse;
import com.glxp.api.res.inout.IoOrderDetailBizResponse;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inv.InvPreinDetailService;
import com.glxp.api.service.inv.InvPreinOrderService;
@ -265,13 +267,13 @@ public class IoCheckInoutService {
orderDetailBizService.insert(orderDetailBizEntity);
//生成单据结果
IoOrderDetailResultEntity orderDetailResultEntity = new IoOrderDetailResultEntity();
BeanUtils.copyProperties(orderDetailCodeEntity, orderDetailResultEntity);
orderDetailResultEntity.setCount(orderDetailCodeEntity.getReCount());
orderDetailResultEntity.setReCount(orderDetailCodeEntity.getReCount());
orderDetailResultEntity.setId(null);
orderDetailResultService.insert(orderDetailResultEntity);
//生成单据结果
IoOrderDetailResultEntity orderDetailResultEntity = new IoOrderDetailResultEntity();
BeanUtils.copyProperties(orderDetailCodeEntity, orderDetailResultEntity);
orderDetailResultEntity.setCount(orderDetailCodeEntity.getReCount());
orderDetailResultEntity.setReCount(orderDetailCodeEntity.getReCount());
orderDetailResultEntity.setId(null);
orderDetailResultService.insert(orderDetailResultEntity);
});
}
@ -729,6 +731,7 @@ public class IoCheckInoutService {
orderEntity.setUpdateTime(new Date());
orderEntity.setAuditTime(new Date());
orderService.update(orderEntity);
List<IoCodeEntity> codeEntities = codeService.findByOrderId(orderEntity.getBillNo());
genInv(orderEntity, bussinessTypeEntity);
}
}
@ -744,76 +747,75 @@ public class IoCheckInoutService {
public void genInv(IoOrderEntity orderEntity, BasicBussinessTypeEntity bussinessTypeEntity) {
if (bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT) && bussinessTypeEntity.isScanPreIn()) {
ThreadUtil.execAsync(() -> {
if (StrUtil.isNotEmpty(bussinessTypeEntity.getPreInBackAction())) {
if (bussinessTypeEntity.getBackPreinType() == 1) { //按单退货
String orderIds = bussinessTypeEntity.getCheckPreInOrders();
if (StrUtil.isNotEmpty(orderIds)) {
String[] orderIdArray = StringUtils.split(",");
List<String> orderList = CollUtil.toList(orderIdArray);
List<IoCodeEntity> outCodeEntitys = codeService.findByOrderId(orderEntity.getBillNo());
List<IoCodeEntity> preInCodeEntities = codeService.findByOrderIds(orderList, null);
// 扣减数量
for (IoCodeEntity preInCodeEntity : preInCodeEntities) {
for (IoCodeEntity codeEntity : outCodeEntitys) {
if (preInCodeEntity.getCode().equals(codeEntity.getCode())) {
int count = preInCodeEntity.getMyCount() - codeEntity.getMyCount();
int reCount = preInCodeEntity.getMyReCount() - codeEntity.getMyReCount();
if (count > 0) {
preInCodeEntity.setCount(count);
preInCodeEntity.setReCount(reCount);
codeEntity.setCount(0);
codeEntity.setReCount(0);
} else if (count < 0) {
preInCodeEntity.setCount(0);
preInCodeEntity.setReCount(0);
codeEntity.setCount(-count);
codeEntity.setReCount(-reCount);
} else {
preInCodeEntity.setCount(0);
preInCodeEntity.setReCount(0);
codeEntity.setCount(0);
codeEntity.setReCount(0);
}
// ThreadUtil.execAsync(() -> {
if (StrUtil.isNotEmpty(bussinessTypeEntity.getPreInBackAction())) {
if (bussinessTypeEntity.getBackPreinType() == 1) { //按单退货
String orderIds = orderEntity.getCheckPreInOrders();
if (StrUtil.isNotEmpty(orderIds)) {
String[] orderIdArray = orderIds.split(",");
List<String> orderList = CollUtil.toList(orderIdArray);
List<IoCodeEntity> outCodeEntitys = codeService.findByOrderId(orderEntity.getBillNo());
List<IoCodeEntity> preInCodeEntities = codeService.findByOrderIds(orderList, null);
// 扣减数量
for (IoCodeEntity preInCodeEntity : preInCodeEntities) {
for (IoCodeEntity codeEntity : outCodeEntitys) {
if (preInCodeEntity.getCode().equals(codeEntity.getCode())) {
int count = preInCodeEntity.getMyCount() - codeEntity.getMyCount();
int reCount = preInCodeEntity.getMyReCount() - codeEntity.getMyReCount();
if (count > 0) {
preInCodeEntity.setCount(count);
preInCodeEntity.setReCount(reCount);
codeEntity.setCount(0);
codeEntity.setReCount(0);
} else if (count < 0) {
preInCodeEntity.setCount(0);
preInCodeEntity.setReCount(0);
codeEntity.setCount(-count);
codeEntity.setReCount(-reCount);
} else {
preInCodeEntity.setCount(0);
preInCodeEntity.setReCount(0);
codeEntity.setCount(0);
codeEntity.setReCount(0);
}
}
}
List<IoCodeEntity> backCodeList = new ArrayList<>();
for (IoCodeEntity codeEntity : preInCodeEntities) {
if (codeEntity.getMyCount() > 0) {
backCodeList.add(codeEntity);
}
}
genBackOrder(orderEntity, backCodeList);
}
} else { //按仓库货位退货
List<IoCodeEntity> backCodeList = new ArrayList<>();
List<IoCodeEntity> codeList = codeService.findByOrderId(orderEntity.getBillNo());
for (IoCodeEntity codeEntity : codeList) {
int count = invPreinProductDetailService.findCountByCode(codeEntity.getCode());
if (count > 0) {
codeEntity.setCount(count);
codeEntity.setReCount(udiCalCountUtil.getActCount(codeEntity.getNameCode()));
for (IoCodeEntity codeEntity : preInCodeEntities) {
if (codeEntity.getMyCount() > 0) {
backCodeList.add(codeEntity);
genBackOrder(orderEntity, backCodeList);
}
}
genBackOrder(orderEntity, backCodeList);
}
} else { //按仓库货位退货
List<IoCodeEntity> backCodeList = new ArrayList<>();
List<IoCodeEntity> codeList = codeService.findByOrderId(orderEntity.getBillNo());
for (IoCodeEntity codeEntity : codeList) {
int count = invPreinProductDetailService.findCountByCode(codeEntity.getCode());
if (count > 0) {
codeEntity.setCount(count);
codeEntity.setReCount(udiCalCountUtil.getActCount(codeEntity.getNameCode()));
backCodeList.add(codeEntity);
genBackOrder(orderEntity, backCodeList);
}
}
}
});
}
// });
}
//校验是否是不入库存单据
if (bussinessTypeEntity.isInStock()) {
//生成库存
@ -830,6 +832,8 @@ public class IoCheckInoutService {
}
}
@Resource
InvWarehouseService invWarehouseService;
public void genBackOrder(IoOrderEntity orderEntity, List<IoCodeEntity> backCodeList) {
if (CollUtil.isEmpty(backCodeList))
@ -837,9 +841,14 @@ public class IoCheckInoutService {
BasicBussinessTypeEntity basicBussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
if (StrUtil.isNotEmpty(basicBussinessTypeEntity.getPreInBackAction())) {
IoOrderEntity outOrder = new IoOrderEntity();
IoCodeEntity codeEntity = backCodeList.get(0);
outOrder.setId(null);
outOrder.setMainAction(ConstantType.TYPE_OUT);
outOrder.setAction(basicBussinessTypeEntity.getAction());
outOrder.setAction(basicBussinessTypeEntity.getPreInBackAction());
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(Constant.INV_PRE_IN_CODE);
outOrder.setInvCode(invWarehouseEntity.getCode());
outOrder.setDeptCode(invWarehouseEntity.getParentId());
outOrder.setFromCorp(codeEntity.getSupId());
outOrder.setCreateTime(new Date());
outOrder.setFromType(ConstantStatus.FROM_BACK);
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(basicBussinessTypeEntity.getPrefix()), "yyyyMMdd"));

@ -2,13 +2,14 @@ package com.glxp.api.service.inout;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.inout.IoCodeLostEntity;
import com.glxp.api.req.inout.IoCodeLostRequest;
import com.glxp.api.res.inout.IoCodeLostResponse;
import java.util.List;
public interface IoCodeLostService extends IService<IoCodeLostEntity> {
List<IoCodeLostResponse> selectLost(IoCodeLostEntity ioCodeLostEntity);
List<IoCodeLostResponse> selectLost(IoCodeLostRequest ioCodeLostRequest);
IoCodeLostEntity findByCode(String code);

@ -119,6 +119,8 @@ public class IoGenInvService {
InvPreProductService invPreProductService;
@Resource
InvPreProductDetailService invPreProductDetailService;
@Resource
InvPreinProductDetailService invPreinProductDetailService;
//生成寄售库存
public void genPreInv(String orderId) {
@ -171,27 +173,78 @@ public class IoGenInvService {
}
@Resource
InvPreinProductService invPreinProductService;
//生成预验收库存
public void genPreInInv(String orderId) {
//入库预验收进入到实际在库码表
IoOrderEntity orderEntity = orderService.findByBillNo(orderId);
InvPreinOrderEntity invPreinOrderEntity = new InvPreinOrderEntity();
BeanUtils.copyProperties(orderEntity, invPreinOrderEntity);
invPreinOrderService.insert(invPreinOrderEntity);
if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
InvPreinOrderEntity invPreinOrderEntity = new InvPreinOrderEntity();
BeanUtils.copyProperties(orderEntity, invPreinOrderEntity);
invPreinOrderService.insert(invPreinOrderEntity);
List<IoCodeEntity> codeEnttities = codeService.findByOrderId(orderId);
List<InvPreinDetailEntity> invPreinDetailEntities = new ArrayList<>();
codeEnttities.forEach(codeEntity ->
{
InvPreinDetailEntity invPreinDetailEntity = new InvPreinDetailEntity();
BeanUtils.copyProperties(codeEntity, invPreinDetailEntity);
invPreinDetailEntity.setId(null);
invPreinDetailEntity.setStatus(ConstantStatus.INVIN_IN);
invPreinDetailEntity.setOriginCount(codeEntity.getCount());
invPreinDetailEntity.setOriginReCount(codeEntity.getReCount());
invPreinDetailEntities.add(invPreinDetailEntity);
});
invPreinDetailService.insertList(invPreinDetailEntities);
}
//走正常流程,生成对应库存
// 生成库存产品信息表
List<IoOrderDetailResultEntity> orderDetailResultEntities = orderDetailResultService.findByOrderId(orderId);
//生成库存产品表
for (IoOrderDetailResultEntity orderDetailResultEntity : orderDetailResultEntities) {
InvPreinProductEntity invProductEntity = invPreinProductService.selectByUnique(orderDetailResultEntity.getBindRlFk(), orderDetailResultEntity.getBatchNo(), orderDetailResultEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode());
if (invProductEntity == null) {
invProductEntity = new InvPreinProductEntity();
invProductEntity.setRelIdFk(orderDetailResultEntity.getBindRlFk());
invProductEntity.setNameCode(orderDetailResultEntity.getNameCode());
invProductEntity.setBatchNo(orderDetailResultEntity.getBatchNo());
invProductEntity.setProductionDate(orderDetailResultEntity.getProductDate());
invProductEntity.setExpireDate(orderDetailResultEntity.getExpireDate());
invProductEntity.setInCount(0);
invProductEntity.setOutCount(0);
invProductEntity.setSupId(orderDetailResultEntity.getSupId());
invProductEntity.setDeptCode(orderEntity.getDeptCode());
invProductEntity.setInvCode(orderEntity.getInvCode());
invProductEntity.setCreateTime(new Date());
invProductEntity.setUpdateTime(new Date());
invPreinProductService.insert(invProductEntity);
}
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
invProductEntity.setOutCount(invProductEntity.getOutCount() + orderDetailResultEntity.getReCount());
} else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
invProductEntity.setInCount(invProductEntity.getInCount() + orderDetailResultEntity.getReCount());
}
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
invProductEntity.setUpdateTime(new Date());
invPreinProductService.update(invProductEntity);
}
List<IoCodeEntity> codeEnttities = codeService.findByOrderId(orderId);
List<InvPreinDetailEntity> invPreinDetailEntities = new ArrayList<>();
codeEnttities.forEach(codeEntity ->
{
InvPreinDetailEntity invPreinDetailEntity = new InvPreinDetailEntity();
BeanUtils.copyProperties(codeEntity, invPreinDetailEntity);
invPreinDetailEntity.setId(null);
invPreinDetailEntity.setStatus(ConstantStatus.INVIN_IN);
invPreinDetailEntity.setOriginCount(codeEntity.getCount());
invPreinDetailEntity.setOriginReCount(codeEntity.getReCount());
invPreinDetailEntities.add(invPreinDetailEntity);
});
invPreinDetailService.insertList(invPreinDetailEntities);
//生成库存码详情
List<InvPreInProductDetailEntity> invProductDetailEntities = new ArrayList<>();
for (IoCodeEntity codeEntity : codeEnttities) {
InvPreInProductDetailEntity invProductDetailEntity = new InvPreInProductDetailEntity();
BeanUtils.copyProperties(codeEntity, invProductDetailEntity);
invProductDetailEntity.setRelId(codeEntity.getRelId());
invProductDetailEntity.setUpdateTime(new Date());
invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON);
invProductDetailEntities.add(invProductDetailEntity);
}
invPreinProductDetailService.insertList(invProductDetailEntities);
}

@ -2,6 +2,7 @@ package com.glxp.api.service.inout.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.req.inout.IoCodeLostRequest;
import com.glxp.api.res.inout.IoCodeLostResponse;
import org.springframework.stereotype.Service;
@ -23,8 +24,8 @@ public class IoCodeLostServiceImpl extends ServiceImpl<IoCodeLostMapper, IoCodeL
@Override
public List<IoCodeLostResponse> selectLost(IoCodeLostEntity ioCodeLostEntity) {
return codeLostEntityMapper.selectLost(ioCodeLostEntity);
public List<IoCodeLostResponse> selectLost(IoCodeLostRequest ioCodeLostRequest) {
return codeLostEntityMapper.selectLost(ioCodeLostRequest);
}
@Override

@ -58,31 +58,31 @@
<insert id="insertIgnoreBussinessType" parameterType="com.glxp.api.entity.basic.BasicBussinessTypeEntity">
insert
ignore
ignore
into basic_bussiness_type (mainAction, action, name, enable, remark, thirdSysFk, genUnit, innerOrder,
secCheckEnable, checkEnable, checkUdims, checkPdaEd, checkPdaUn, checkPc,
checkWebNew, checkSp, checkChange, secCheckUdims, secCheckPdaEd, secCheckPdaUn,
secCheckPc, secCheckWebNew, secCheckChange, secCheckSp, corpType,
supplementOrderType, checkBalance, secCheckBalance, useDyCount, expireTip,
updateTime, defaultUnit, prefix, outToSpms, ullageFill, scanPreIn, vailInv,
entrutSpms, codeFillCheck, defaultSubInv, defaultInv, orderVisibleType,
preInBack, supplementAll, createUser, createTime, updateUser, vailDispatch,
vailGroupBuy, busType, inStock, actionType, thrCheckEnable, thrCheckWebNew,
thrCheckPdaUn, thrCheckPdaEd, thrCheckUdims, thrCheckPc, thrCheckSp,
thrCheckChange, thrCheckBalance, thrCheckCopy, fillCodeRel, checkVailDate,
checkExpire, checkCertExpire, preInBackAction, backPreinType, checkPreInOrders,sortNum)
secCheckEnable, checkEnable, checkUdims, checkPdaEd, checkPdaUn, checkPc,
checkWebNew, checkSp, checkChange, secCheckUdims, secCheckPdaEd, secCheckPdaUn,
secCheckPc, secCheckWebNew, secCheckChange, secCheckSp, corpType,
supplementOrderType, checkBalance, secCheckBalance, useDyCount, expireTip,
updateTime, defaultUnit, prefix, outToSpms, ullageFill, scanPreIn, vailInv,
entrutSpms, codeFillCheck, defaultSubInv, defaultInv, orderVisibleType,
preInBack, supplementAll, createUser, createTime, updateUser, vailDispatch,
vailGroupBuy, busType, inStock, actionType, thrCheckEnable, thrCheckWebNew,
thrCheckPdaUn, thrCheckPdaEd, thrCheckUdims, thrCheckPc, thrCheckSp,
thrCheckChange, thrCheckBalance, thrCheckCopy, fillCodeRel, checkVailDate,
checkExpire, checkCertExpire, preInBackAction, backPreinType, sortNum)
values (#{mainAction}, #{action}, #{name}, #{enable}, #{remark}, #{thirdSysFk}, #{genUnit}, #{innerOrder},
#{secCheckEnable}, #{checkEnable}, #{checkUdims}, #{checkPdaEd}, #{checkPdaUn}, #{checkPc},
#{checkWebNew}, #{checkSp}, #{checkChange}, #{secCheckUdims}, #{secCheckPdaEd}, #{secCheckPdaUn},
#{secCheckPc}, #{secCheckWebNew}, #{secCheckChange}, #{secCheckSp}, #{corpType},
#{supplementOrderType}, #{checkBalance}, #{secCheckBalance}, #{useDyCount}, #{expireTip},
#{updateTime}, #{defaultUnit}, #{prefix}, #{outToSpms}, #{ullageFill}, #{scanPreIn}, #{vailInv},
#{entrutSpms}, #{codeFillCheck}, #{defaultSubInv}, #{defaultInv}, #{orderVisibleType},
#{preInBack}, #{supplementAll}, #{createUser}, #{createTime}, #{updateUser}, #{vailDispatch},
#{vailGroupBuy}, #{busType}, #{inStock}, #{actionType}, #{thrCheckEnable}, #{thrCheckWebNew},
#{thrCheckPdaUn}, #{thrCheckPdaEd}, #{thrCheckUdims}, #{thrCheckPc}, #{thrCheckSp},
#{thrCheckChange}, #{thrCheckBalance}, #{thrCheckCopy}, #{fillCodeRel}, #{checkVailDate},
#{checkExpire}, #{checkCertExpire}, #{preInBackAction}, #{backPreinType}, #{checkPreInOrders}, #{sortNum})
#{secCheckEnable}, #{checkEnable}, #{checkUdims}, #{checkPdaEd}, #{checkPdaUn}, #{checkPc},
#{checkWebNew}, #{checkSp}, #{checkChange}, #{secCheckUdims}, #{secCheckPdaEd}, #{secCheckPdaUn},
#{secCheckPc}, #{secCheckWebNew}, #{secCheckChange}, #{secCheckSp}, #{corpType},
#{supplementOrderType}, #{checkBalance}, #{secCheckBalance}, #{useDyCount}, #{expireTip},
#{updateTime}, #{defaultUnit}, #{prefix}, #{outToSpms}, #{ullageFill}, #{scanPreIn}, #{vailInv},
#{entrutSpms}, #{codeFillCheck}, #{defaultSubInv}, #{defaultInv}, #{orderVisibleType},
#{preInBack}, #{supplementAll}, #{createUser}, #{createTime}, #{updateUser}, #{vailDispatch},
#{vailGroupBuy}, #{busType}, #{inStock}, #{actionType}, #{thrCheckEnable}, #{thrCheckWebNew},
#{thrCheckPdaUn}, #{thrCheckPdaEd}, #{thrCheckUdims}, #{thrCheckPc}, #{thrCheckSp},
#{thrCheckChange}, #{thrCheckBalance}, #{thrCheckCopy}, #{fillCodeRel}, #{checkVailDate},
#{checkExpire}, #{checkCertExpire}, #{preInBackAction}, #{backPreinType}, #{sortNum})
</insert>
<select id="selectBusList" resultType="com.glxp.api.entity.basic.BasicBussinessTypeEntity">
@ -154,15 +154,15 @@
select name, action
from basic_bussiness_type
where mainAction = #{mainAction}
and corpType = 3
and (supplementOrderType is null
or supplementOrderType = '')
and corpType = 3
and (supplementOrderType is null
or supplementOrderType = '')
</select>
<select id="selectByUser" resultType="com.glxp.api.entity.basic.BasicBussinessTypeEntity">
select basic_bussiness_type.*
from basic_bussiness_type
inner join auth_user_bustype on basic_bussiness_type.action = auth_user_bustype.scAction
inner join auth_user_bustype on basic_bussiness_type.action = auth_user_bustype.scAction
<where>
<if test="name != null and name != ''">
AND basic_bussiness_type.name like concat('%', #{name}, '%')
@ -193,7 +193,7 @@
resultType="com.glxp.api.res.basic.BasicBussinessTypeResponse">
SELECT basic_bussiness_type.*
FROM basic_bussiness_type
left JOIN auth_user_bustype ON basic_bussiness_type.action = auth_user_bustype.scAction
left JOIN auth_user_bustype ON basic_bussiness_type.action = auth_user_bustype.scAction
<where>
<if test="name != ''and name != null">
AND basic_bussiness_type.name LIKE concat('%', #{name}, '%')
@ -231,7 +231,7 @@
resultType="com.glxp.api.res.basic.BasicBussinessTypeResponse">
SELECT basic_bussiness_type.*
FROM basic_bussiness_type
left JOIN auth_warehouse_bustype ON basic_bussiness_type.action = auth_warehouse_bustype.action
left JOIN auth_warehouse_bustype ON basic_bussiness_type.action = auth_warehouse_bustype.action
<where>
<if test="name != ''and name != null">
AND basic_bussiness_type.name LIKE concat('%', #{name}, '%')

@ -1,29 +1,28 @@
<?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.inout.IoCodeLostMapper">
<select id="selectLost" parameterType="com.glxp.api.entity.inout.IoCodeLostEntity"
<select id="selectLost" parameterType="com.glxp.api.req.inout.IoCodeLostRequest"
resultType="com.glxp.api.res.inout.IoCodeLostResponse">
select io_code_lost.*,basic_products.cpmctymc ,basic_products.ggxh from io_code_lost
LEFT JOIN basic_products on io_code_lost.nameCode=basic_products.nameCode
select io_code_lost.*, basic_products.cpmctymc, basic_products.ggxh
from io_code_lost
LEFT JOIN basic_products on io_code_lost.nameCode = basic_products.nameCode
<where>
<if test="code != '' and code != null">
and code like concat('%',#{code},'%')
and code like concat('%', #{code}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
and basic_products.cpmctymc like concat('%',#{cpmctymc},'%')
and basic_products.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
<if test="ggxh != '' and ggxh != null">
and basic_products.ggxh like concat('%',#{ggxh},'%')
and basic_products.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="batchNo != '' and batchNo != null">
and batchNo like concat('%',#{batchNo},'%')
and batchNo like concat('%', #{batchNo}, '%')
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(io_code_lost.createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d')
</if>
</where>
</select>
</mapper>

@ -30,4 +30,7 @@
group by io_order_detail_code.id
</select>
<update id="updateCount">
update io_order_detail_code set count = #{count}, reCount = #{reCount} where id = #{id}
</update>
</mapper>

@ -58,7 +58,7 @@
resultType="com.glxp.api.entity.basic.BasicProductsEntity">
SELECT b2.*
FROM pur_receive_detail p1
LEFT JOIN basic_udirel b1 on b1.id = p1.productId
LEFT JOIN basic_udirel b1 on b1.id = p1.relIdFk
LEFT JOIN basic_products b2 on b1.uuid = b2.uuid
<where>
<if test="id != null and id != ''">

@ -3,33 +3,32 @@
<mapper namespace="com.glxp.api.dao.inv.InvPreinProductDao">
<select id="filterList" resultType="com.glxp.api.res.inv.InvPreinProductResponse">
select ipp.id,
ipp.nameCode,
bp.cpmctymc,
ipp.relIdFk,
bp.ggxh,
ipp.batchNo,
ipp.productionDate,
ipp.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
ipp.inCount,
ipp.outCount,
ipp.reCount,
ipp.customerId,
basic_corp.name supName,
ipp.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
ipp.deptCode,
ipp.invCode
ipp.nameCode,
bp.cpmctymc,
ipp.relIdFk,
bp.ggxh,
ipp.batchNo,
ipp.productionDate,
ipp.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
ipp.inCount,
ipp.outCount,
ipp.reCount,
ipp.customerId,
basic_corp.name supName,
ipp.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
ipp.deptCode,
ipp.invCode
from inv_prein_product ipp
inner join basic_udirel on ipp.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ipp.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ipp.deptCode
left join auth_warehouse on auth_warehouse.code = ipp.invCode
inner join basic_udirel on ipp.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ipp.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ipp.deptCode
left join auth_warehouse on auth_warehouse.code = ipp.invCode
<where>
bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
@ -81,11 +80,11 @@
<select id="filterPreProductList" resultType="com.glxp.api.entity.inv.InvPreinProductEntity">
select ipp.*
from inv_prein_product ipp
inner join basic_udirel on ipp.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ipp.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ipp.deptCode
left join auth_warehouse on auth_warehouse.code = ipp.invCode
inner join basic_udirel on ipp.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ipp.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ipp.deptCode
left join auth_warehouse on auth_warehouse.code = ipp.invCode
<where>
bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''">

@ -193,7 +193,7 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'advancePreIn', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'sortNum', 'int', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'preInBackAction', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'backPreinType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'checkPreInOrders', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkPreInOrders', 'varchar(255)', 1);
# CALL Pro_Temp_ColumnWork('sup_cert_set', 'foreign', 'tinyint', 3);
# CALL Pro_Temp_ColumnWork('sup_cert_set', 'needForeign', 'tinyint', 1);

Loading…
Cancel
Save