代码备份

master
anthonyywj2 3 years ago
parent ef237c7479
commit 93399fadc9

@ -10,6 +10,7 @@ import com.glxp.api.admin.entity.basic.BussinessOriginTypeEntity;
import com.glxp.api.admin.httpclient.ErpBasicClient;
import com.glxp.api.admin.req.basic.BussinessOriginTypeFilterRequest;
import com.glxp.api.admin.req.basic.FilterBasicThirdSysDetailRequest;
import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.BussinessOriginTypeResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
@ -37,8 +38,6 @@ public class BussinessOriginTypeController {
private BussinessOriginTypeService bussinessOriginTypeService;
@Resource
ErpBasicClient erpBasicClient;
@Resource
private BasicThirdSysDetailService basicThirdSysDetailService;
@AuthRuleAnnotation("")
@GetMapping("/udiwms/originBusType/filter")
@ -110,6 +109,21 @@ public class BussinessOriginTypeController {
return ResultVOUtils.success("更新成功");
}
@PostMapping("/udiwms/originBusType/delete")
public BaseResponse delBussinessType(@RequestBody DeleteRequest deleteRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (deleteRequest != null) {
bussinessOriginTypeService.deleteById(deleteRequest.getId());
} else {
return ResultVOUtils.error(999, "参数错误");
}
return ResultVOUtils.success("更新成功");
}
@PostMapping("/udiwms/originBusType/download")
public BaseResponse dlBusType(@RequestBody @Valid BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest,
BindingResult bindingResult) {

@ -1,5 +1,6 @@
package com.glxp.api.admin.controller.business;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.constant.Constant;
@ -48,6 +49,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -282,6 +284,9 @@ public class StockOrderDetailController {
stockOrderDetailEntity.setManufactory(udiInfoEntity.getManufactory());
stockOrderDetailEntity.setYlqxzcrbarmc(udiInfoEntity.getYlqxzcrbarmc());
stockOrderDetailEntity.setZczbhhzbapzbh(udiInfoEntity.getZczbhhzbapzbh());
if(StrUtil.isNotEmpty(udiInfoEntity.getPrice())){
stockOrderDetailEntity.setPrice(new BigDecimal(udiInfoEntity.getPrice()));
}
if (stockOrderIdsRequest.getUdiEntity() != null) {
UdiEntity udiEntity = stockOrderIdsRequest.getUdiEntity();
stockOrderDetailEntity.setBatchNo(udiEntity.getBatchNo());

@ -1,11 +1,14 @@
package com.glxp.api.admin.controller.info;
import com.alibaba.fastjson.JSON;
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.res.info.SyncDataSetResponse;
import com.glxp.api.admin.service.info.SyncDataSetService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -28,10 +31,15 @@ public class SyncDataSetController {
return ResultVOUtils.success(syncDataSetService.selectSet());
}
@AuthRuleAnnotation("system/param/syncData/save")
@PostMapping("/system/param/syncData/save")
public BaseResponse save(@RequestBody @Valid SyncDataSetEntity syncDataSetEntity
public BaseResponse save(@RequestBody @Valid SyncDataSetResponse syncDataSetResponse
) {
SyncDataSetEntity syncDataSetEntity = new SyncDataSetEntity();
BeanUtils.copyProperties(syncDataSetResponse, syncDataSetEntity);
syncDataSetEntity.setBusTypes(JSON.toJSONString(syncDataSetResponse.getBusTypes()));
boolean b = syncDataSetService.insert(syncDataSetEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
@ -39,5 +47,4 @@ public class SyncDataSetController {
return ResultVOUtils.success();
}
}

@ -0,0 +1,171 @@
package com.glxp.api.admin.controller.inventory;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.constant.ConstantType;
import com.glxp.api.admin.entity.info.CompanyEntity;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inventory.InvProductDetailResponse;
import com.glxp.api.admin.res.inventory.InvProductPageRespnonse;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import com.glxp.api.admin.res.inventory.InvProductStatResponse;
import com.glxp.api.admin.service.info.CompanyService;
import com.glxp.api.admin.service.inventory.InvPreInProductDetailService;
import com.glxp.api.admin.service.inventory.InvPreInProductService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
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.ArrayList;
import java.util.List;
@RestController
public class InvPreInProductsController {
@Resource
InvPreInProductService invProductService;
@Resource
InvPreInProductDetailService invProductDetailService;
@Resource
private CompanyService companyService;
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/filter")
public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) {
boolean showSup = false;
// if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) {
// filterInvProductRequest.setCustomerId(null);
// showSup = true;
// } else {
// CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId()));
// filterInvProductRequest.setSupId(companyEntity.getUnitIdFk());
// filterInvProductRequest.setCustomerId(null);
// }
List<InvProductResponse> invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest);
PageInfo<InvProductResponse> pageInfo;
pageInfo = new PageInfo<>(invProductResponses);
InvProductPageRespnonse<InvProductResponse> pageSimpleResponse = new InvProductPageRespnonse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(invProductResponses);
pageSimpleResponse.setShowSup(showSup);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/isExist")
public BaseResponse isExistInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
List<InvProductDetailEntity> invProductResponses = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
if (CollUtil.isNotEmpty(invProductResponses)) {
return ResultVOUtils.success("success");
}
return ResultVOUtils.error(501, "库存不存在此产品");
}
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/getAllCode")
public BaseResponse getAllCodees(FilterInvProductDetailRequest filterInvProductDetailRequest) {
List<String> invProductResponses = invProductDetailService.findAllCode(filterInvProductDetailRequest);
if (CollUtil.isNotEmpty(invProductResponses)) {
return ResultVOUtils.success(invProductResponses);
}
return ResultVOUtils.error(501, "未入库");
}
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/filterDetail")
public BaseResponse filterInvProductDetail(FilterInvProductDetailRequest filterInvProductRequest) {
if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) {
filterInvProductRequest.setCustomerId(null);
}
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest);
PageInfo<InvProductDetailEntity> pageInfo;
pageInfo = new PageInfo<>(invProductDetailEntities);
List<InvProductDetailResponse> invProductDetailResponses = new ArrayList<>();
if (invProductDetailEntities.size() > 0) {
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
InvProductDetailResponse invProductDetailResponse = new InvProductDetailResponse();
BeanUtils.copyProperties(invProductDetailEntity, invProductDetailResponse);
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
invProductDetailResponse.setMainActionStr("出库");
invProductDetailResponse.setOutCount(invProductDetailEntity.getCount());
} else {
invProductDetailResponse.setMainActionStr("入库");
invProductDetailResponse.setInCount(invProductDetailEntity.getCount());
}
invProductDetailResponses.add(invProductDetailResponse);
}
}
PageSimpleResponse<InvProductDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(invProductDetailResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@PostMapping("spms/prein/inv/products/delete")
public BaseResponse deleteInvProduct(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String id = deleteRequest.getId();
InvProductEntity invProductEntity = invProductService.selectById(id);
if (invProductEntity != null) {
invProductService.deleteById(id);
FilterInvProductDetailRequest detailRequest = new FilterInvProductDetailRequest();
detailRequest.setSupId(invProductEntity.getSupId());
detailRequest.setBatchNo(invProductEntity.getBatchNo());
detailRequest.setProductIdFk(invProductEntity.getRelIdFk());
invProductDetailService.deleteByProductId(detailRequest);
return ResultVOUtils.success("删除成功");
} else {
return ResultVOUtils.error(500, "删除失败!");
}
}
@AuthRuleAnnotation("")
@GetMapping("spms/prein/inv/products/stat")
public BaseResponse statInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
InvProductStatResponse invProductStatResponse = new InvProductStatResponse();
//统计预入库数量
FilterInvProductDetailRequest temp1 = new FilterInvProductDetailRequest();
BeanUtils.copyProperties(filterInvProductDetailRequest, temp1);
temp1.setPurchaseType(ConstantStatus.PRUCHASE_ADVANCE);
invProductStatResponse.setAdvanceCount(invProductDetailService.statCount(temp1));
//统计普通采购数量
FilterInvProductDetailRequest temp2 = new FilterInvProductDetailRequest();
BeanUtils.copyProperties(filterInvProductDetailRequest, temp2);
temp2.setPurchaseType(ConstantStatus.PRUCHASE_COMMON);
invProductStatResponse.setCommonCount(invProductDetailService.statCount(temp2));
//统计入库数量
FilterInvProductDetailRequest temp3 = new FilterInvProductDetailRequest();
BeanUtils.copyProperties(filterInvProductDetailRequest, temp3);
temp3.setMainAction(ConstantType.TYPE_PUT);
invProductStatResponse.setInCount(invProductDetailService.statCount(temp3));
//统计出库数量
FilterInvProductDetailRequest temp4 = new FilterInvProductDetailRequest();
BeanUtils.copyProperties(filterInvProductDetailRequest, temp4);
temp4.setMainAction(ConstantType.TYPE_OUT);
invProductStatResponse.setOutCount(invProductDetailService.statCount(temp4));
return ResultVOUtils.success(invProductStatResponse);
}
}

@ -0,0 +1,86 @@
package com.glxp.api.admin.controller.thrsys;
//领用单
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrOrderEntity;
import com.glxp.api.admin.req.business.StockOrderPostRequest;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.thrsys.ThrOrderDetailService;
import com.glxp.api.admin.service.thrsys.ThrOrderService;
import com.glxp.api.admin.util.DateUtil;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
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 ThrOrderReceiveController {
@Resource
private ThrOrderService thrOrderService;
@Resource
private ThrOrderDetailService thrOrderDetailService;
@Resource
CustomerService customerService;
@AuthRuleAnnotation("")
@PostMapping("/udiwms/thrsys/order/insertWeb")
public BaseResponse insertWeb(@RequestBody StockOrderPostRequest stockOrderPostRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
Integer userId = customerService.getUserId();
ThrOrderEntity stockOrderEntity = new ThrOrderEntity();
// Integer id = Integer.parseInt(CustomUtil.getId());
BeanUtils.copyProperties(stockOrderPostRequest, stockOrderEntity);
stockOrderEntity.setCreateUser(userId + "");
stockOrderEntity.setType(1);//领用单据
stockOrderEntity.setUpdateTime(new Date());
stockOrderEntity.setBilldate(DateUtil.formatDate(new Date()));
// stockOrderEntity.setId(id);
ThrOrderEntity temp = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk());
if (temp != null) {
stockOrderEntity.setId(temp.getId());
}
thrOrderService.insertThrOrder(stockOrderEntity);
stockOrderEntity = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk());
if (stockOrderPostRequest.getSubErpOrders() != null) {
List<StockOrderDetailEntity> stockOrderDetailEntityList = stockOrderPostRequest.getSubErpOrders();
for (StockOrderDetailEntity stockOrderDetailEntity : stockOrderDetailEntityList) {
ThrOrderDetailEntity thrOrderDetailEntity = new ThrOrderDetailEntity();
BeanUtils.copyProperties(stockOrderDetailEntity, thrOrderDetailEntity);
thrOrderDetailEntity.setOrderIdFk(
StringUtils.isBlank(stockOrderDetailEntity.getOrderIdFk()) ?
stockOrderEntity.getId() + "" : stockOrderDetailEntity.getOrderIdFk());
if (StringUtils.isBlank(stockOrderDetailEntity.getId())) {
thrOrderDetailEntity.setReCount(
stockOrderDetailEntity.getReCount());
thrOrderDetailEntity.setCount(
stockOrderDetailEntity.getCount());
thrOrderDetailService.insertThrOrderDetail(thrOrderDetailEntity);
}
}
return ResultVOUtils.success("成功");
}
return ResultVOUtils.success("成功");
}
}

@ -1,10 +1,10 @@
package com.glxp.api.admin.dao.basic;
import com.glxp.api.admin.entity.basic.BussinessLocalTypeEntity;
import com.glxp.api.admin.entity.basic.BussinessOriginTypeEntity;
import com.glxp.api.admin.req.basic.BussinessOriginTypeFilterRequest;
import com.glxp.api.admin.res.basic.BussinessOriginTypeResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -20,4 +20,6 @@ public interface BussinessOriginTypeDao {
boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity);
boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity);
boolean deleteById(@Param("id") String id);
}

@ -0,0 +1,31 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface InvPreInProductDao {
List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest);
List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest);
boolean insertInvProduct(InvProductEntity invProductEntity);
boolean updateInvProduct(InvProductEntity invProductEntity);
InvProductEntity selectByUuid(@Param("relIdFk") String relIdFk, @Param("batchNo") String batchNo,
@Param("supId") String supId, @Param("invStorageCode") String invStorageCode,
@Param("invWarehouseCode") String invWarehouseCode);
InvProductEntity selectById(@Param("id") String id);
InvProductEntity selectExit(@Param("relIdFk") String id);
boolean deleteById(@Param("id") String id);
}

@ -0,0 +1,31 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.res.inventory.InvProductDetailJoinResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface InvPreInProductDetailDao {
List<InvProductDetailEntity> filterInvProductDetail(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);
boolean insertInvProductDetail(InvProductDetailEntity invProductDetailEntity);
boolean insertInvProductDetails(@Param("invProductDetailEntitys") List<InvProductDetailEntity> invProductDetailEntitys);
boolean updateInvProductDetail(InvProductDetailEntity invProductDetailEntity);
boolean deleteById(@Param("id") String id);
boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest);
int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest);
}

@ -27,4 +27,6 @@ public class BussinessLocalTypeEntity {
private Date updateTime;
private String prefix;
private String localPrefix;
private boolean preIn;
}

@ -55,4 +55,6 @@ public class BussinessTypeEntity {
private Date updateTime;
private String prefix;
private String localPrefix;
private boolean preIn;
}

@ -20,5 +20,5 @@ public class CompanyProductRelevanceEntity {
private String productUuid;
private Integer udiRlIdFk;
private String unitFk;
private String price;
}

@ -20,4 +20,8 @@ public class SyncDataSetEntity {
private boolean downstreamEnable;
private Integer syncTime; //定时上传时间
private Integer syncDonwloadTime; //定时下载时间
private boolean orderUnReceive;
private boolean orderUnCheck;
private String busTypes;
}

@ -58,5 +58,6 @@ public class BussinessTypResponse {
private String prefix;
private String localPrefix;
private boolean preIn;
}

@ -65,4 +65,5 @@ public class CompanyProductRelevanceResponse {
private String scbssfbhsxrq;
private String cpms;
private String supName;
private String price;
}

@ -0,0 +1,29 @@
package com.glxp.api.admin.res.info;
import lombok.Data;
import java.util.List;
@Data
public class SyncDataSetResponse {
private Integer id;
private boolean typeBus;
private boolean typeScan;
private boolean typeThird;
private boolean basicProducts;
private boolean basicCorp;
private boolean basicInv;
private boolean basicThirdProducts;
private boolean basicThirdCorp;
private boolean basicThirdInv;
private boolean basicThirdBusOrder;
private boolean dbDiProducts;
private boolean downstreamEnable;
private boolean orderScanFinish;
private boolean orderUnReceive;
private boolean orderUnCheck;
private List<String> busTypes;
private Integer syncTime;
private Integer syncDonwloadTime; //定时下载时间
}

@ -5,6 +5,7 @@ import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.basic.BussinessOriginTypeEntity;
import com.glxp.api.admin.req.basic.BussinessOriginTypeFilterRequest;
import com.glxp.api.admin.res.basic.BussinessOriginTypeResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -37,4 +38,6 @@ public interface BussinessOriginTypeService {
//扫码单据
BussinessOriginTypeResponse finByMainAction(String action);
boolean deleteById(String id);
}

@ -120,4 +120,9 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic
}
return null;
}
@Override
public boolean deleteById(String id) {
return bussinessOriginTypeDao.deleteById(id);
}
}

@ -2,10 +2,12 @@ package com.glxp.api.admin.service.info;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.res.info.SyncDataSetResponse;
public interface SyncDataSetService {
SyncDataSetEntity findSet();
SyncDataSetEntity selectSet();
SyncDataSetResponse selectSet();
boolean insert(SyncDataSetEntity syncDataSetEntity);
}

@ -1,11 +1,15 @@
package com.glxp.api.admin.service.info.impl;
import com.alibaba.fastjson.JSON;
import com.glxp.api.admin.dao.info.SyncDataSetDao;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.res.info.SyncDataSetResponse;
import com.glxp.api.admin.service.info.SyncDataSetService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class SyncDataSetServiceImpl implements SyncDataSetService {
@ -14,10 +18,25 @@ public class SyncDataSetServiceImpl implements SyncDataSetService {
SyncDataSetDao syncDataSetDao;
@Override
public SyncDataSetEntity selectSet() {
return syncDataSetDao.selectSet();
public SyncDataSetEntity findSet() {
SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet();
return syncDataSetEntity;
}
@Override
public SyncDataSetResponse selectSet() {
SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet();
SyncDataSetResponse syncDataSetResponse = new SyncDataSetResponse();
BeanUtils.copyProperties(syncDataSetEntity, syncDataSetResponse);
List<String> busTypes = JSON.parseArray(syncDataSetEntity.getBusTypes(), String.class);
syncDataSetResponse.setBusTypes(busTypes);
return syncDataSetResponse;
}
@Override
public boolean insert(SyncDataSetEntity syncDataSetEntity) {
return syncDataSetDao.insert(syncDataSetEntity);

@ -0,0 +1,30 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.res.inventory.InvProductDetailJoinResponse;
import java.util.List;
public interface InvPreInProductDetailService {
List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest);
boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity);
boolean insertInvProducts(List<InvProductDetailEntity> invProductDetailEntitys);
boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity);
boolean deleteById(String id);
boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest);
int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest);
}

@ -0,0 +1,26 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import java.util.List;
public interface InvPreInProductService {
List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest);
List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest);
InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode);
InvProductEntity selectExit(String id);
InvProductEntity selectById(String id);
boolean insertInvProduct(InvProductEntity invProductEntity);
boolean updateInvProduct(InvProductEntity invProductEntity);
boolean deleteById(String id);
}

@ -0,0 +1,81 @@
package com.glxp.api.admin.service.inventory.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.inventory.InvPreInProductDetailDao;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.res.inventory.InvProductDetailJoinResponse;
import com.glxp.api.admin.service.inventory.InvPreInProductDetailService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailService {
@Resource
InvPreInProductDetailDao invPreInProductDetailDao;
@Override
public List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
if (filterInvProductDetailRequest == null) {
return Collections.emptyList();
}
if (filterInvProductDetailRequest.getPage() != null) {
int offset = (filterInvProductDetailRequest.getPage() - 1) * filterInvProductDetailRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductDetailRequest.getLimit());
}
List<InvProductDetailEntity> data = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
return data;
}
@Override
public List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) {
if (filterInvProductDetailRequest == null) {
return Collections.emptyList();
}
if (filterInvProductDetailRequest.getPage() != null) {
int offset = (filterInvProductDetailRequest.getPage() - 1) * filterInvProductDetailRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductDetailRequest.getLimit());
}
List<InvProductDetailJoinResponse> data = invPreInProductDetailDao.filterJoinInvProduct(filterInvProductDetailRequest);
return data;
}
@Override
public boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity) {
return invPreInProductDetailDao.insertInvProductDetail(invProductDetailEntity);
}
@Override
public boolean insertInvProducts(List<InvProductDetailEntity> invProductDetailEntitys) {
return invPreInProductDetailDao.insertInvProductDetails(invProductDetailEntitys);
}
@Override
public boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity) {
return invPreInProductDetailDao.updateInvProductDetail(invProductDetailEntity);
}
@Override
public boolean deleteById(String id) {
return invPreInProductDetailDao.deleteById(id);
}
@Override
public boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest) {
return invPreInProductDetailDao.deleteByProductId(filterInvProductDetailRequest);
}
@Override
public int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest) {
return invPreInProductDetailDao.statCount(filterInvProductDetailRequest);
}
@Override
public List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest) {
return invPreInProductDetailDao.findAllCode(filterInvProductDetailRequest);
}
}

@ -0,0 +1,77 @@
package com.glxp.api.admin.service.inventory.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.inventory.InvPreInProductDao;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import com.glxp.api.admin.service.inventory.InvPreInProductService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class InvPreInProductServiceImpl implements InvPreInProductService {
@Resource
InvPreInProductDao invPreInProductDao;
@Override
public List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest) {
if (filterInvProductRequest == null) {
return Collections.emptyList();
}
if (filterInvProductRequest.getPage() != null) {
int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductRequest.getLimit());
}
List<InvProductEntity> data = invPreInProductDao.filterInvProduct(filterInvProductRequest);
return data;
}
@Override
public List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest) {
if (filterInvProductRequest == null) {
return Collections.emptyList();
}
if (filterInvProductRequest.getPage() != null) {
int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit();
PageHelper.offsetPage(offset, filterInvProductRequest.getLimit());
}
List<InvProductResponse> data = invPreInProductDao.filterJoinInvProduct(filterInvProductRequest);
return data;
}
@Override
public InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode) {
return invPreInProductDao.selectByUuid(uuid, batchNo, supId, invStorageCode, invWarehouseCode);
}
@Override
public InvProductEntity selectExit(String id) {
return invPreInProductDao.selectExit(id);
}
@Override
public InvProductEntity selectById(String id) {
return invPreInProductDao.selectById(id);
}
@Override
public boolean insertInvProduct(InvProductEntity invProductEntity) {
return invPreInProductDao.insertInvProduct(invProductEntity);
}
@Override
public boolean updateInvProduct(InvProductEntity invProductEntity) {
return invPreInProductDao.updateInvProduct(invProductEntity);
}
@Override
public boolean deleteById(String id) {
return invPreInProductDao.deleteById(id);
}
}

@ -58,6 +58,10 @@ public class InvProductsTrService {
@Resource
private InvPreProductDetailService invPreProductDetailService;
@Resource
private InvPreInProductService invPreInProductService;
@Resource
private InvPreInProductDetailService invPreInProductDetailService;
@Resource
private BussinessChangeTypeService bussinessChangeTypeService;
@Resource
private BasicUnitMaintainService basicUnitMaintainService;
@ -95,7 +99,25 @@ public class InvProductsTrService {
List<WarehouseEntity> warehouseEntityList = codesService.findByReceiptId(orderId);
for (WarehouseEntity warehouseEntity : warehouseEntityList) {
ErpOrderEntity erpOrderEntity = getErpOrders(warehouseEntity, erpOrderEntities);
if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
if (bussinessTypeEntity.isPreIn()) {
InvProductEntity invPreProductEntity =
invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
, warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invPreInProductService.insertInvProduct(invPreProductEntity);
} else {
int actCount = getActCount(warehouseEntity);
int count = actCount * warehouseEntity.getCount();
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
invPreProductEntity.setOutCount(invPreProductEntity.getOutCount() + count);
} else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
invPreProductEntity.setInCount(invPreProductEntity.getInCount() + count);
}
invPreInProductService.updateInvProduct(invPreProductEntity);
}
} else if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
InvProductEntity invPreProductEntity =
invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
, warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
@ -185,14 +207,14 @@ public class InvProductsTrService {
// insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
buildPreInOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据
} else {
insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
}
} else {
insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
}
} else {
insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存
insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
}
}
@ -502,8 +524,8 @@ public class InvProductsTrService {
outOrder.setFromCorp(invWarehouseEntity.getName());
outOrder.setFromCorpId(invWarehouseEntity.getCode());
outOrder.setLocStorageCode(defaultWarehouseEntity.getCode());
// outOrder.setFromCorp(companyEntity.getCompanyName());
// outOrder.setFromCorpId(companyEntity.getUnitIdFk());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : preOutList) {
warehouseEntity.setOrderId(outOrder.getId());
@ -576,7 +598,8 @@ public class InvProductsTrService {
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
@ -623,7 +646,8 @@ public class InvProductsTrService {
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
warehouseEntity.setOrderId(outOrder.getId());
warehouseEntity.setId(null);
@ -696,7 +720,8 @@ public class InvProductsTrService {
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
@ -777,7 +802,8 @@ public class InvProductsTrService {
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
outOrder.setOriginUllageSupNo(orderEntity.getId());
outOrder.setCreateUser(null);
outOrder.setReviewUser(null);
orderService.insertOrder(outOrder);
for (WarehouseEntity warehouseEntity : temps) {
warehouseEntity.setOrderId(outOrder.getId());
@ -865,27 +891,6 @@ public class InvProductsTrService {
invProductDetailEntity.setUpdateTime(new Date());
invProductDetailEntity.setCustomerId(orderEntity.getCustomerId());
invProductDetailEntity.setSupId(warehouseEntity.getSupId());
// if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
// if (warehouseEntity.getSupId() != null) {
// invProductDetailEntity.setSupId(warehouseEntity.getSupId());
// } else {
// FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
// filterInvProductDetailRequest.setMainAction(ConstantType.TYPE_PUT);
// filterInvProductDetailRequest.setCode(warehouseEntity.getCode());
// List<InvProductDetailEntity> temps = null;
// if (isPre) {
// temps = invPreProductDetailService.filterInvProduct(filterInvProductDetailRequest);
// } else {
// temps = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
// }
// if (temps.size() > 0) {
// invProductDetailEntity.setSupId(temps.get(0).getSupId());
// }
// }
// } else {
// invProductDetailEntity.setSupId(orderEntity.getFromCorpId());
// }
mInvProductDetailEntities.add(invProductDetailEntity);
}
}
@ -894,9 +899,11 @@ public class InvProductsTrService {
return mInvProductDetailEntities;
}
public void insetInv(boolean isPre, List<InvProductDetailEntity> invProductDetailEntities) {
if (isPre) {
public void insetInv(BussinessTypeEntity bussinessTypeEntity, List<InvProductDetailEntity> invProductDetailEntities) {
if (bussinessTypeEntity.isAdvanceType()) {
invPreProductDetailService.insertInvProducts(invProductDetailEntities);
} else if (bussinessTypeEntity.isPreIn()) {
invPreInProductDetailService.insertInvProducts(invProductDetailEntities);
} else {
invProductDetailService.insertInvProducts(invProductDetailEntities);
}
@ -1022,30 +1029,6 @@ public class InvProductsTrService {
}
//根据条码获取预入库结余数量
public int getPreCountByOrder(String mainAction, String code, String supId) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setCode(code);
filterInvProductDetailRequest.setSupId(supId);
if (mainAction != null)
filterInvProductDetailRequest.setMainAction(mainAction);
List<InvProductDetailJoinResponse> detailJoinResponseList
= invPreProductDetailService.filterJoinInvProduct(filterInvProductDetailRequest);
int invCount = 0;
if (detailJoinResponseList != null && detailJoinResponseList.size() > 0) {
for (InvProductDetailJoinResponse invProductDetailJoinResponse : detailJoinResponseList) {
if (invProductDetailJoinResponse.getMainAction().equals(ConstantType.TYPE_OUT)) {
invCount = invCount - invProductDetailJoinResponse.getCount();
} else {
invCount = invCount + invProductDetailJoinResponse.getCount();
}
}
}
return invCount;
}
public int getPreCountByOrder(String mainAction, String relId, String batchNo, String supId, String invWarehouseCode) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setSupId(supId);
@ -1070,53 +1053,6 @@ public class InvProductsTrService {
}
//根据条码获取库存结余数量
public int getCountByProduct(String mainAction, String productId, String batchNo, String supId) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setProductIdFk(productId);
filterInvProductDetailRequest.setBatchNo(batchNo);
filterInvProductDetailRequest.setSupId(supId);
if (mainAction != null)
filterInvProductDetailRequest.setMainAction(mainAction);
List<InvProductDetailJoinResponse> detailJoinResponseList
= invProductDetailService.filterJoinInvProduct(filterInvProductDetailRequest);
int invCount = 0;
if (detailJoinResponseList != null && detailJoinResponseList.size() > 0) {
for (InvProductDetailJoinResponse invProductDetailJoinResponse : detailJoinResponseList) {
if (invProductDetailJoinResponse.getMainAction().equals(ConstantType.TYPE_OUT)) {
invCount = invCount - invProductDetailJoinResponse.getCount();
} else {
invCount = invCount + invProductDetailJoinResponse.getCount();
}
}
}
return invCount;
}
//根据条码获取预入库结余数量
public int getPreCountByProduct(String mainAction, String productId, String batchNo, String supId) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setProductIdFk(productId);
filterInvProductDetailRequest.setBatchNo(batchNo);
filterInvProductDetailRequest.setSupId(supId);
if (mainAction != null)
filterInvProductDetailRequest.setMainAction(mainAction);
List<InvProductDetailJoinResponse> detailJoinResponseList
= invPreProductDetailService.filterJoinInvProduct(filterInvProductDetailRequest);
int invCount = 0;
if (detailJoinResponseList != null && detailJoinResponseList.size() > 0) {
for (InvProductDetailJoinResponse invProductDetailJoinResponse : detailJoinResponseList) {
if (invProductDetailJoinResponse.getMainAction().equals(ConstantType.TYPE_OUT)) {
invCount = invCount - invProductDetailJoinResponse.getCount();
} else {
invCount = invCount + invProductDetailJoinResponse.getCount();
}
}
}
return invCount;
}
//合并条码
public List<WarehouseEntity> filterMapCodes(List<WarehouseEntity> warehouseEntityList) {
Map<String, WarehouseEntity> filterMap = new HashMap<>();
@ -1141,7 +1077,6 @@ public class InvProductsTrService {
public boolean isAdavnce(WarehouseEntity warehouseEntity) {
//获取普通出入库结余数量
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
// filterInvProductDetailRequest.setCode(warehouseEntity.getCode());
filterInvProductDetailRequest.setProductIdFk(warehouseEntity.getRelId());
filterInvProductDetailRequest.setSupId(warehouseEntity.getSupId());
List<InvProductDetailJoinResponse> detailJoinResponseList

@ -18,9 +18,10 @@ public class CustomUtil {
String id = System.currentTimeMillis() + "";
int number = new Random().nextInt(90) + 10;
id = id + number;
return id.substring(4);
return id.substring(1);
}
public static <T> List<List<T>> splitList(List<T> list, int len) {
if (list == null || list.isEmpty() || len < 1) {

@ -74,6 +74,7 @@
basic_bussiness_type.name ,
basic_bussiness_type.action,basic_bussiness_type.checkEnable,basic_bustype_local.advanceType,basic_bustype_local.changeEnable,
basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.corpType,basic_bussiness_type.mainAction,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix
,basic_bustype_local.preIn
FROM basic_bustype_local
inner join basic_bussiness_type
on basic_bustype_local.action = basic_bussiness_type.localAction
@ -126,7 +127,7 @@
basic_bussiness_type.action,basic_bussiness_type.checkEnable,basic_bustype_local.advanceType,basic_bustype_local.changeEnable,
basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.corpType,basic_bussiness_type.mainAction,
basic_bussiness_type.defaultUnit,basic_bussiness_type.genUnit,basic_bustype_origin.action
thirdAction,basic_bustype_origin.thirdSys,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix
thirdAction,basic_bustype_origin.thirdSys,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix,basic_bustype_local.preIn
FROM basic_bustype_local
inner join basic_bussiness_type on basic_bustype_local.action = basic_bussiness_type.localAction
INNER JOIN inv_warehouse_bussiness_type on basic_bussiness_type.action = inv_warehouse_bussiness_type.action
@ -164,6 +165,7 @@
basic_bussiness_type.name ,
basic_bussiness_type.action,basic_bussiness_type.checkEnable,basic_bustype_local.advanceType,basic_bustype_local.changeEnable,
basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.corpType,basic_bussiness_type.mainAction,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix
,basic_bustype_local.preIn
FROM basic_bustype_local
LEFT JOIN basic_bussiness_type on basic_bussiness_type.localAction = basic_bustype_local.action
<where>
@ -184,7 +186,7 @@
parameterType="com.glxp.api.admin.entity.basic.BussinessLocalTypeEntity">
replace
INTO basic_bustype_local
(action, name, remark, originAction, advanceType, changeEnable, spUse,updateTime,prefix)
(action, name, remark, originAction, advanceType, changeEnable, spUse,updateTime,prefix,preIn)
values (
#{action},
#{name},
@ -193,7 +195,7 @@
#{advanceType},
#{changeEnable},
#{spUse},
#{updateTime},#{prefix}
#{updateTime},#{prefix},#{preIn}
)
</insert>
@ -210,7 +212,7 @@
<if test="spUse != null">spUse = #{spUse},</if>
<if test="updateTime != null">updateTime = #{updateTime},</if>
<if test="prefix != null">prefix = #{prefix},</if>
<if test="preIn != null">preIn = #{preIn},</if>
</trim>
WHERE id = #{id}
</update>

@ -45,7 +45,7 @@
AND basic_bustype_origin.action = #{thirdAction}
</if>
<if test="corpType != ''and corpType != null">
AND basic_bussiness_type.action = #{corpType}
AND basic_bussiness_type.corpType = #{corpType}
</if>
</where>
@ -95,4 +95,11 @@
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_bustype_origin
WHERE id = #{id}
</delete>
</mapper>

@ -18,7 +18,7 @@
basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,
basic_bussiness_type.secCheckBalacne, defaultUnit,basic_bustype_origin.action
thirdAction,basic_bustype_origin.thirdSys,basic_bussiness_type.useDyCount,basic_bussiness_type.expireTip,
basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix
basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix,basic_bustype_local.preIn
FROM basic_bussiness_type LEFT JOIN basic_bustype_local
on basic_bussiness_type.localAction = basic_bustype_local.action
left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action
@ -83,7 +83,7 @@
basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType,
basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,defaultUnit,
basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.expireTip,
basic_bustype_local.prefix localPrefix
basic_bustype_local.prefix localPrefix,basic_bustype_local.preIn
from
basic_bussiness_type LEFT JOIN
basic_third_sys on basic_bussiness_type.thirdSysFk =
@ -135,6 +135,7 @@
basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,defaultUnit,
basic_bussiness_type.secCheckBalacne,basic_bustype_origin.action
thirdAction,basic_bustype_origin.thirdSys,useDyCount,basic_bussiness_type.expireTip,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix
,basic_bustype_local.preIn
FROM basic_bussiness_type LEFT JOIN basic_bustype_local
on basic_bussiness_type.localAction = basic_bustype_local.action
left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action

@ -28,7 +28,7 @@
<select id="filterUdiGp" parameterType="com.glxp.api.admin.req.basic.CompanyProductRelevanceRequest"
resultType="com.glxp.api.admin.res.info.CompanyProductRelevanceResponse">
select
company_product_relevance.id,company_product_relevance.customerId,company_product_relevance.auditStatus,
company_product_relevance.id,company_product_relevance.customerId,company_product_relevance.auditStatus,company_product_relevance.price,
basic_udirel.thirdId,basic_udirel.thirdName,basic_udirel.id rlId,
basic_udirel.isUseDy, basic_udirel.isLock,
basic_udirel.thirdId1,basic_udirel.thirdId2,
@ -48,7 +48,7 @@
basic_udirel.mainId,basic_udirel.mainName,basic_udirel.isAdavence,basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid,basic_corp.name companyName
basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid,basic_corp.name companyName,basic_udirel.allowNoBatch
FROM company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id
@ -232,7 +232,7 @@
<if test="productUuid != null">productUuid=#{productUuid},</if>
<if test="udiRlIdFk != null">udiRlIdFk=#{udiRlIdFk},</if>
<if test="unitFk != null">unitFk=#{unitFk},</if>
<if test="price != null">price=#{price},</if>
</set>
WHERE id = #{id}
</update>
@ -241,7 +241,7 @@
parameterType="com.glxp.api.admin.entity.basic.CompanyProductRelevanceEntity">
replace
INTO company_product_relevance(customerId,productId,enterpriseId,registrationId,
create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk) values
create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk,price) values
(
#{customerId},
#{productId},
@ -252,7 +252,7 @@
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}
#{unitFk},#{price}
)
</insert>
@ -260,7 +260,7 @@
parameterType="com.glxp.api.admin.entity.basic.CompanyProductRelevanceEntity">
replace
INTO company_product_relevance(id,customerId,productId,enterpriseId,registrationId,
create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk) values
create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk,price) values
(
#{id},
#{customerId},
@ -272,7 +272,7 @@
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}
#{unitFk},#{price}
)
</insert>

@ -15,7 +15,7 @@
replace
INTO sync_data_set(id,typeBus, typeScan,
typeThird, basicProducts, basicCorp, basicInv, basicThirdProducts, basicThirdCorp, basicThirdInv
, basicThirdBusOrder, orderScanFinish, dbDiProducts,downstreamEnable,syncTime,)
, basicThirdBusOrder, orderScanFinish, dbDiProducts,downstreamEnable,syncTime, syncDonwloadTime,orderUnReceive,orderUnCheck,busTypes)
values (
#{id},
#{typeBus},
@ -29,7 +29,8 @@
#{basicThirdInv},
#{basicThirdBusOrder},
#{orderScanFinish},
#{dbDiProducts},#{downstreamEnable},#{syncTime},#{syncDonwloadTime}
#{dbDiProducts},#{downstreamEnable},#{syncTime},#{syncDonwloadTime},
#{orderUnReceive},#{orderUnCheck},#{busTypes}
)
</insert>

@ -257,11 +257,13 @@
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="userid != null">
and userId = #{userid}
</if>
<if test="isDirector != '' and isDirector != null">
AND isDirector = #{isDirector}
</if>
</where>
</select>

@ -0,0 +1,231 @@
<?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.inventory.InvPreInProductDao">
<select id="filterInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
SELECT * FROM inv_prein_product
<where>
<if test="productsName != '' and productsName != null">
AND productsName = #{productsName}
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode = #{nameCode}
</if>
<if test="relIdFk != '' and relIdFk != null">
AND relIdFk = #{relIdFk}
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh = #{ggxh}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="productionDate != '' and productionDate != null">
AND productionDate = #{productionDate}
</if>
<if test="expireDate != '' and expireDate != null">
AND expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc = #{ylqxzcrbarmc}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh = #{zczbhhzbapzbh}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
<if test="invCodes != null and invCodes.size > 0">
AND invStorageCode IN
<foreach collection="invCodes" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
<if test="groupType != '' and groupType != null">
GROUP BY #{groupType}
</if>
</select>
<select id="selectById" parameterType="Map"
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
SELECT *
FROM inv_prein_product
WHERE id = #{id}
</select>
<select id="selectByUuid" parameterType="Map"
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
SELECT *
FROM inv_prein_product
<where>
relIdFk = #{relIdFk}
and invStorageCode = #{invStorageCode}
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="supId == null">
AND supId is NULL
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
<if test="invWarehouseCode == null">
AND invWarehouseCode is NULL
</if>
</where>
</select>
<select id="selectExit" parameterType="Map"
resultType="com.glxp.api.admin.entity.inventory.InvProductEntity">
SELECT *
FROM inv_prein_product
<where>
relIdFk = #{relIdFk}
</where>
limit 1
</select>
<!-- and supId = #{supId}-->
<select id="filterJoinInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest"
resultType="com.glxp.api.admin.res.inventory.InvProductResponse">
SELECT
inv_prein_product.id,
basic_products.cpmctymc,basic_products.nameCode,inv_prein_product.relIdFk,basic_products.ggxh,
inv_prein_product.batchNo
,inv_prein_product.productionDate,inv_prein_product.expireDate,
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,
inv_prein_product.inCount,inv_prein_product.outCount
,inv_prein_product.reCount,inv_prein_product.customerId,
basic_corp.name companyName,inv_prein_product.supId,inv_prein_product.unitFk ,inv_warehouse.name
invStorageName,inv_prein_product.invStorageCode
FROM inv_prein_product
inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id
inner join basic_products on basic_udirel.uuid = basic_products.uuid
left join basic_corp on inv_prein_product.supId=basic_corp.erpId
left join inv_warehouse on inv_warehouse.code=inv_prein_product.invStorageCode
<where>
basic_products.diType=1
<if test="cpmctymc != '' and cpmctymc != null">
AND basic_products.cpmctymc = #{cpmctymc}
</if>
<if test="nameCode != '' and nameCode != null">
AND basic_products.nameCode = #{nameCode}
</if>
<if test="relIdFk != '' and relIdFk != null">
AND inv_prein_product.relIdFk = #{relIdFk}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
<if test="ggxh != '' and ggxh != null">
AND basic_products.ggxh = #{ggxh}
</if>
<if test="batchNo != '' and batchNo != null">
AND inv_prein_product.batchNo = #{batchNo}
</if>
<if test="productionDate != '' and productionDate != null">
AND inv_prein_product.productionDate = #{productionDate}
</if>
<if test="expireDate != '' and expireDate != null">
AND inv_prein_product.expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND basic_products.ylqxzcrbarmc = #{ylqxzcrbarmc}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND basic_products.zczbhhzbapzbh = #{zczbhhzbapzbh}
</if>
<if test="customerId != '' and customerId != null">
AND inv_prein_product.customerId = #{customerId}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
<if test="invCodes != null and invCodes.size > 0">
AND invStorageCode IN
<foreach collection="invCodes" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
<if test="groupType != '' and groupType != null">
GROUP BY #{groupType}
</if>
</select>
<insert id="insertInvProduct" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
insert INTO inv_prein_product
(productsName, nameCode, relIdFk, ggxh, batchNo,
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh,
inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode)
values (#{productsName}, #{nameCode},
#{relIdFk}, #{ggxh}, #{batchNo},
#{productionDate}, #{expireDate},
#{ylqxzcrbarmc}, #{zczbhhzbapzbh},
#{inCount}, #{outCount}, #{reCount}, #{customerId}, #{supId}, #{unitFk}
, #{invStorageCode}, #{invWarehouseCode})
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM inv_prein_product
WHERE id = #{id}
</delete>
<update id="updateInvProduct" parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
UPDATE inv_prein_product
<trim prefix="set" suffixOverrides=",">
<if test="productsName != null">productsName=#{productsName},</if>
<if test="nameCode != null">nameCode=#{nameCode},</if>
<if test="relIdFk != null">relIdFk=#{relIdFk},</if>
<if test="ggxh != null">ggxh=#{ggxh},</if>
<if test="batchNo != null">batchNo=#{batchNo},</if>
<if test="productionDate != null">productionDate=#{productionDate},</if>
<if test="expireDate != null">expireDate=#{expireDate},</if>
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
<if test="inCount != null">inCount=#{inCount},</if>
<if test="outCount != null">outCount=#{outCount},</if>
<if test="reCount != null">reCount=#{reCount},</if>
<if test="customerId != null">customerId=#{customerId},</if>
<if test="supId != null">supId=#{supId},</if>
<if test="unitFk != null">unitFk=#{unitFk},</if>
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
</trim>
WHERE id = #{id}
</update>
</mapper>

@ -0,0 +1,273 @@
<?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.inventory.InvPreInProductDetailDao">
<select id="filterInvProductDetail" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest"
resultType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity">
SELECT * FROM inv_prein_product_detail
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="mainAction != '' and mainAction != null">
AND mainAction = #{mainAction}
</if>
<if test="action != '' and action != null">
AND action = #{action}
</if>
<if test="count != '' and count != null">
AND count = #{count}
</if>
<if test="purchaseType != null">
AND purchaseType = #{purchaseType}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="originCode != '' and originCode != null">
AND originCode = #{originCode}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
</where>
</select>
<select id="findAllCode" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest"
resultType="java.lang.String">
SELECT originCode FROM inv_prein_product_detail
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="mainAction != '' and mainAction != null">
AND mainAction = #{mainAction}
</if>
<if test="action != '' and action != null">
AND action = #{action}
</if>
<if test="count != '' and count != null">
AND count = #{count}
</if>
<if test="purchaseType != null">
AND purchaseType = #{purchaseType}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="originCode != '' and originCode != null">
AND originCode = #{originCode}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
</where>
</select>
<select id="filterJoinInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest"
resultType="com.glxp.api.admin.res.inventory.InvProductDetailJoinResponse">
SELECT inv_prein_product_detail.* ,io_order.fromCorp,io_order.fromCorpId FROM inv_prein_product_detail
inner join io_order on inv_prein_product_detail.orderIdFk = io_order.id
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="mainAction != '' and mainAction != null">
AND inv_prein_product_detail.mainAction = #{mainAction}
</if>
<if test="action != '' and action != null">
AND inv_prein_product_detail.action = #{action}
</if>
<if test="count != '' and count != null">
AND count = #{count}
</if>
<if test="purchaseType != null">
AND purchaseType = #{purchaseType}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="supId != '' and supId != null">
AND inv_prein_product_detail.supId = #{supId}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="originCode != '' and originCode != null">
AND originCode = #{originCode}
</if>
<if test="invStorageCode != '' and invStorageCode != null">
AND invStorageCode = #{invStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode != null">
AND invWarehouseCode = #{invWarehouseCode}
</if>
</where>
</select>
<insert id="insertInvProductDetail" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity">
insert INTO inv_prein_product_detail
(code, productIdFk, orderIdFk, customerId, mainAction, action, count, updateTime,
purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId, originCode
, invStorageCode, invWarehouseCode)
values (#{code},
#{productIdFk}, #{orderIdFk},
#{customerId}, #{mainAction}, #{action}, #{count}, #{updateTime},
#{purchaseType}, #{batchNo}, #{productionDate}, #{expireDate}, #{unitFk}, #{stockIdFk}
, #{supId}, #{originCode}, #{invStorageCode}, #{invWarehouseCode})
</insert>
<insert id="insertInvProductDetails" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity">
insert INTO inv_prein_product_detail
(code, productIdFk, orderIdFk, customerId, mainAction, action, count, updateTime,
purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId,originCode
, invStorageCode, invWarehouseCode)
values
<foreach collection="invProductDetailEntitys" item="item" index="index"
separator=",">
(
#{item.code},
#{item.productIdFk},#{item.orderIdFk},
#{item.customerId},#{item.mainAction},#{item.action},#{item.count},#{item.updateTime},
#{item.purchaseType}, #{item.batchNo}, #{item.productionDate}, #{item.expireDate},
#{item.unitFk},#{item.stockIdFk},#{item.supId},#{item.originCode}, #{item.invStorageCode},
#{item.invWarehouseCode}
)
</foreach>
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM inv_prein_product_detail
WHERE id = #{id}
</delete>
<delete id="deleteByProductId" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest">
DELETE
FROM inv_prein_product_detail
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
</where>
</delete>
<update id="updateInvProductDetail" parameterType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity">
UPDATE inv_prein_product_detail
<trim prefix="set" suffixOverrides=",">
<if test="code != null">code=#{code},</if>
<if test="productIdFk != null">productIdFk=#{productIdFk},</if>
<if test="customerId != null">customerId=#{customerId},</if>
<if test="mainAction != null">mainAction=#{mainAction},</if>
<if test="action != null">action=#{action},</if>
<if test="count != null">count=#{count},</if>
<if test="unitFk != null">unitFk=#{unitFk},</if>
<if test="purchaseType != null">purchaseType=#{purchaseType},</if>
<if test="batchNo != null">batchNo=#{batchNo},</if>
<if test="productionDate != null">productionDate=#{productionDate},</if>
<if test="expireDate != null">expireDate=#{expireDate},</if>
<if test="stockIdFk != null">stockIdFk=#{stockIdFk},</if>
<if test="supId != null">supId=#{supId},</if>
<if test="originCode != null">originCode=#{originCode},</if>
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
</trim>
WHERE id = #{id}
</update>
<select id="statCount" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest"
resultType="java.lang.Integer">
SELECT count(0) FROM inv_prein_product_detail
<where>
<if test="productIdFk != '' and productIdFk != null">
AND productIdFk = #{productIdFk}
</if>
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="mainAction != '' and mainAction != null">
AND mainAction = #{mainAction}
</if>
<if test="action != '' and action != null">
AND action = #{action}
</if>
<if test="purchaseType != null">
AND purchaseType = #{purchaseType}
</if>
<if test="batchNo != '' and batchNo != null">
AND batchNo = #{batchNo}
</if>
<if test="unitFk != '' and unitFk != null">
AND unitFk = #{unitFk}
</if>
<if test="stockIdFk != '' and stockIdFk != null">
AND stockIdFk = #{stockIdFk}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save