摆货相关修改,添加货位查询,预验收,寄售等相关库存摆货

master
anthonywj 2 years ago
parent a9fd3f2c2b
commit 3cae7526bc

@ -285,5 +285,5 @@ public class Constant {
public static final String ORDER_ACTION_SUP_INOUT = "supInout";
public static final String ORDER_ACTION_SUP_PREIN = "preInOrder";
public static final String SYNC_REMARK = "syncRemark";
}

@ -269,7 +269,7 @@ public class InvWarehouseController extends BaseController {
}
InvWarehouseEntity originEntity = invWarehouseService.findByInvSubByCode(invWarehouseEntity.getCode());
if (!originEntity.getParentId().equals(invWarehouseEntity.getParentId()) || !originEntity.getParentCode().equals(invWarehouseEntity.getParentCode())) {
if (!originEntity.getParentId().equals(invWarehouseEntity.getParentId()) || (originEntity.getParentCode() != null && !originEntity.getParentCode().equals(invWarehouseEntity.getParentCode()))) {
Integer userCount = warehouseUserService.countUserBySubInvCode(invWarehouseEntity.getCode());
if (userCount > 0) {
return ResultVOUtils.error(500, "修改部门或上级仓库时,请先移除该仓库关联用户!");

@ -52,8 +52,7 @@ public class InvPlaceController {
if (null == bindInvSpaceRequest) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
invPlaceService.bindInvSpace(bindInvSpaceRequest);
return ResultVOUtils.success("绑定成功");
return invPlaceService.bindInvSpace(bindInvSpaceRequest);
}
/**

@ -74,8 +74,14 @@ public class InvProductController extends BaseController {
filterInvProductRequest.setInvCodes(invCodes);
}
}
List<InvProductResponse> list;
if (StrUtil.isNotEmpty(filterInvProductRequest.getInvSpaceCode())) {
list = invProductService.findGroupBySpace(filterInvProductRequest);
} else {
list = invProductService.filterListProduct(filterInvProductRequest);
}
List<InvProductResponse> list = invProductService.filterListProduct(filterInvProductRequest);
PageInfo<InvProductResponse> pageInfo = new PageInfo<>(list);
InvProductPageResponse<InvProductResponse> pageResponse = new InvProductPageResponse();
pageResponse.setList(pageInfo.getList());

@ -2,9 +2,14 @@ package com.glxp.api.dao.inv;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inv.InvPreInProductDetailEntity;
import com.glxp.api.req.inv.FilterInvPlaceRequest;
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
import com.glxp.api.req.inv.FilterInvPreinProductRequest;
import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.res.inv.InvPlaceDetailResponse;
import com.glxp.api.res.inv.InvPreinProductResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -22,6 +27,8 @@ public interface InvPreInProductDetailDao extends BaseMapperPlus<InvPreInProduct
*/
List<InvPreInProductDetailEntity> filterPreProductDetailList(FilterInvPreProductDetailRequest filterInvPreProductDetailRequest);
List<InvPreinProductResponse> findGroupBySpace(FilterInvPreinProductRequest filterInvPreinProductRequest);
/**
*
*
@ -29,4 +36,9 @@ public interface InvPreInProductDetailDao extends BaseMapperPlus<InvPreInProduct
* @return
*/
boolean deleteInvPreProductDetail(FilterInvProductDetailRequest detailRequest);
List<InvPlaceDetailResponse> getInvProductInfo(FilterInvPlaceRequest filterInvPlaceRequest);
void batchBindSpace(@Param("ids") List<Integer> ids, @Param("invSpaceCode") String invSpaceCode);
}

@ -2,8 +2,11 @@ package com.glxp.api.dao.inv;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inv.InvPreProductEntity;
import com.glxp.api.req.inv.FilterInvPlaceRequest;
import com.glxp.api.req.inv.FilterInvPreProductRequest;
import com.glxp.api.res.inv.InvPlaceDetailResponse;
import com.glxp.api.res.inv.InvPreProductResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -20,6 +23,8 @@ public interface InvPreProductDao extends BaseMapperPlus<InvPreProductDao, InvPr
*/
List<InvPreProductResponse> filterList(FilterInvPreProductRequest invPreProductRequest);
/**
*
*
@ -28,4 +33,5 @@ public interface InvPreProductDao extends BaseMapperPlus<InvPreProductDao, InvPr
*/
List<InvPreProductEntity> filterPreProductList(FilterInvPreProductRequest invPreProductRequest);
}
}

@ -2,8 +2,13 @@ package com.glxp.api.dao.inv;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
import com.glxp.api.req.inv.FilterInvPlaceRequest;
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
import com.glxp.api.req.inv.FilterInvPreinProductRequest;
import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.res.inv.InvPlaceDetailResponse;
import com.glxp.api.res.inv.InvPreinProductResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -12,6 +17,9 @@ import java.util.List;
*/
public interface InvPreProductDetailDao extends BaseMapperPlus<InvPreProductDetailDao, InvPreProductDetailEntity, InvPreProductDetailEntity> {
List<InvPreinProductResponse> findGroupBySpace(FilterInvPreinProductRequest filterInvPreinProductRequest);
/**
*
*
@ -27,4 +35,9 @@ public interface InvPreProductDetailDao extends BaseMapperPlus<InvPreProductDeta
* @return
*/
boolean deleteInvPreProductDetail(FilterInvProductDetailRequest detailRequest);
}
List<InvPlaceDetailResponse> getInvProductInfo(FilterInvPlaceRequest filterInvPlaceRequest);
void batchBindSpace(@Param("ids") List<Integer> ids, @Param("invSpaceCode") String invSpaceCode);
}

@ -5,6 +5,7 @@ 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 org.apache.ibatis.annotations.Param;
import java.util.List;
@ -22,6 +23,8 @@ public interface InvPreinProductDao extends BaseMapperPlus<InvPreinProductDao, I
*/
List<InvPreinProductResponse> filterList(FilterInvPreinProductRequest invPreProductRequest);
void batchBindSpace(@Param("ids") List<Integer> ids, @Param("invSpaceCode") String invSpaceCode);
/**
*
*

@ -3,10 +3,14 @@ package com.glxp.api.dao.inv;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inv.InvProductDetailEntity;
import com.glxp.api.req.inv.FilterInvPlaceRequest;
import com.glxp.api.req.inv.FilterInvPreinProductRequest;
import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.req.inv.FilterInvProductRequest;
import com.glxp.api.res.inout.IoOrderResponse;
import com.glxp.api.res.inv.BindInvSpaceRequest;
import com.glxp.api.res.inv.InvPlaceDetailResponse;
import com.glxp.api.res.inv.InvPreinProductResponse;
import com.glxp.api.res.inv.InvProductResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -23,6 +27,9 @@ public interface InvProductDetailDao extends BaseMapperPlus<InvProductDetailDao,
*/
List<InvProductDetailEntity> filterInvProductDetailList(FilterInvProductDetailRequest filterInvProductDetailRequest);
List<InvProductResponse> findGroupBySpace(FilterInvProductRequest filterInvProductRequest);
/**
*
*

@ -34,7 +34,7 @@ public class BasicExportStatusEntity {
private Date endTime;
private String remark;
@TableField(value = "receiveStatus")
private Integer receiveStatus;
private String receiveStatus;
@TableField(value = "cacheFilePath")
private String cacheFilePath;

@ -208,10 +208,10 @@ public class SpGetHttpClient {
}
public BaseResponse<List<BasicExportStatusEntity>> getBasicStatus(String type) {
public BaseResponse<List<BasicExportStatusEntity>> getBasicStatus(String type,String status) {
Map<String, String> paramMap = new HashMap<>(16);
paramMap.put("type", type);
paramMap.put("status", "1");
paramMap.put("status", status);
String response = okHttpCli.doGet(getIpUrl() + "/spssync/basic/udiinfo/getStatus", paramMap, buildHeader());
try {
BaseResponse<List<BasicExportStatusEntity>> data =

@ -88,6 +88,11 @@ public class FilterInvPreinProductRequest extends ListPageRequest {
*/
private String invCode;
// 货位编码
private String spaceCode;
/**
*
*/

@ -127,4 +127,6 @@ public class InvPreProductDetailResponse {
*/
private String orderTime;
private String invSpaceName;
}

@ -126,4 +126,7 @@ public class InvProductDetailResponse {
*
*/
private String orderTime;
private String invSpaceName;
}

@ -95,6 +95,9 @@ public class InvProductResponse {
*/
private String invName;
// 货位名称
private String spaceName;
/**
*
*/

@ -13,4 +13,5 @@ public class BaseSyncResponse {
private String updateTime;
private String type;
private String idDatas;
private String syncRemark;
}

@ -2,6 +2,8 @@ package com.glxp.api.res.system;
import lombok.Data;
import java.util.Date;
@Data
public class SystemPDFTemplateRelevanceResponse {
@ -22,5 +24,6 @@ public class SystemPDFTemplateRelevanceResponse {
private String remark2;
private String remark3;
private int printType;
private Date updateTime;
}

@ -18,6 +18,8 @@ public interface InvSpaceService extends IService<InvSpace> {
*/
List<InvSpaceResponse> filterList(FilterInvSpaceRequest filterInvSpaceRequest);
InvSpace findByCode(String invCode, String spaceCode);
/**
*
*

@ -1,7 +1,9 @@
package com.glxp.api.service.auth.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.enums.ResultEnum;
@ -44,6 +46,17 @@ public class InvSpaceServiceImpl extends ServiceImpl<InvSpaceDao, InvSpace> impl
return invSpaceDao.filterList(filterInvSpaceRequest);
}
@Override
public InvSpace findByCode(String invCode, String spaceCode) {
if (StrUtil.isEmpty(invCode) || StrUtil.isEmpty(spaceCode))
return null;
List<InvSpace> invSpaces = invSpaceDao.selectList(new QueryWrapper<InvSpace>()
.eq("invWarehouseCode", invCode).eq("code", spaceCode).last("limit 1"));
if (CollUtil.isNotEmpty(invSpaces))
return invSpaces.get(0);
return null;
}
@Override
public BaseResponse addSpace(InvSpace invSpace) {
BaseResponse verifyResult = verifySpaceParams(invSpace);
@ -56,7 +69,7 @@ public class InvSpaceServiceImpl extends ServiceImpl<InvSpaceDao, InvSpace> impl
}
//获取当前仓库下的最大货位编码
String maxSpaceCode = invSpaceDao.getMaxSpaceCode(invSpace.getInvWarehouseCode());
String maxSpaceCode = invSpaceDao.getMaxSpaceCode(null);
if (StrUtil.isBlank(maxSpaceCode)) {
maxSpaceCode = "0000";
}
@ -68,7 +81,8 @@ public class InvSpaceServiceImpl extends ServiceImpl<InvSpaceDao, InvSpace> impl
invSpace.setUpdateTime(date);
invSpace.setCreateUser(user.getUserName());
invSpace.setUpdateUser(user.getUserName());
invSpaceDao.insertEntity(invSpace);
invSpace.setId(IdUtil.getSnowflakeNextId());
invSpaceDao.insert(invSpace);
return ResultVOUtils.success();
}

@ -1,6 +1,7 @@
package com.glxp.api.service.inv;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.auth.InvSpace;
import com.glxp.api.req.inv.FilterInvPlaceRequest;
import com.glxp.api.res.inout.IoOrderResponse;
import com.glxp.api.res.inv.BindInvSpaceRequest;
@ -26,7 +27,7 @@ public interface InvPlaceService {
*
* @param bindInvSpaceRequest
*/
void bindInvSpace(BindInvSpaceRequest bindInvSpaceRequest);
BaseResponse bindInvSpace(BindInvSpaceRequest bindInvSpaceRequest);
/**
*

@ -33,6 +33,8 @@ public interface InvProductService {
*/
List<InvProductResponse> filterListProduct(FilterInvProductRequest filterInvProductRequest);
List<InvProductResponse> findGroupBySpace(FilterInvProductRequest filterInvProductRequest);
/**
* ID
*

@ -7,9 +7,16 @@ import com.github.pagehelper.PageHelper;
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.ConstantStatus;
import com.glxp.api.dao.auth.InvSpaceDao;
import com.glxp.api.dao.auth.InvWarehouseDao;
import com.glxp.api.dao.inv.InvPreInProductDetailDao;
import com.glxp.api.dao.inv.InvPreProductDetailDao;
import com.glxp.api.dao.inv.InvProductDetailDao;
import com.glxp.api.entity.auth.InvSpace;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.inv.InvPreInProductDetailEntity;
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
import com.glxp.api.entity.inv.InvProductDetailEntity;
import com.glxp.api.req.inv.AddInvPlaceOrderRequest;
import com.glxp.api.req.inv.FilterInvPlaceRequest;
@ -18,11 +25,14 @@ import com.glxp.api.res.inv.BindInvSpaceRequest;
import com.glxp.api.res.inv.InvPlaceDetailResponse;
import com.glxp.api.service.inv.InvPlaceOrderService;
import com.glxp.api.service.inv.InvPlaceService;
import com.glxp.api.util.BeanCopyUtils;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@ -35,6 +45,10 @@ public class InvPlaceServiceImpl implements InvPlaceService {
@Resource
private InvProductDetailDao invProductDetailDao;
@Resource
private InvPreProductDetailDao invPreProductDetailDao;
@Resource
private InvPreInProductDetailDao invPreInProductDetailDao;
@Resource
private InvWarehouseDao invWarehouseDao;
@Resource
private InvSpaceDao invSpaceDao;
@ -52,20 +66,62 @@ public class InvPlaceServiceImpl implements InvPlaceService {
return invProductDetailDao.selectPlaceDetailList(filterInvPlaceRequest);
}
@Override
public void bindInvSpace(BindInvSpaceRequest bindInvSpaceRequest) {
public BaseResponse bindInvSpace(BindInvSpaceRequest bindInvSpaceRequest) {
//查询仓库的部门ID
String deptCode = invWarehouseDao.selectParentIdByCode(bindInvSpaceRequest.getInvCode());
List<InvProductDetailEntity> list = invProductDetailDao.selectList(new QueryWrapper<InvProductDetailEntity>()
.select("id", "code", "relId", "batchNo")
.eq("deptCode", deptCode)
.eq("invCode", bindInvSpaceRequest.getInvCode())
.in("code", bindInvSpaceRequest.getCodeArray())
);
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.filterGroupInvSubAndcode(bindInvSpaceRequest.getInvCode());
List<InvProductDetailEntity> list = new ArrayList<>();
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
List<InvPreInProductDetailEntity> invPreInProductDetailEntities = invPreInProductDetailDao.selectList(new QueryWrapper<InvPreInProductDetailEntity>()
.select("id", "code", "relId", "batchNo")
.eq("deptCode", deptCode)
.eq("invCode", bindInvSpaceRequest.getInvCode())
.in("code", bindInvSpaceRequest.getCodeArray())
);
for (InvPreInProductDetailEntity invPreInProductDetailEntity : invPreInProductDetailEntities) {
InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity();
BeanCopyUtils.copy(invPreInProductDetailEntity, invProductDetailEntity);
list.add(invProductDetailEntity);
}
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) {
List<InvPreProductDetailEntity> invPreProductDetailEntities = invPreProductDetailDao.selectList(new QueryWrapper<InvPreProductDetailEntity>()
.select("id", "code", "relId", "batchNo")
.eq("deptCode", deptCode)
.eq("invCode", bindInvSpaceRequest.getInvCode())
.in("code", bindInvSpaceRequest.getCodeArray())
);
for (InvPreProductDetailEntity invPreInProductDetailEntity : invPreProductDetailEntities) {
InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity();
BeanCopyUtils.copy(invPreInProductDetailEntity, invProductDetailEntity);
list.add(invProductDetailEntity);
}
} else {
list = invProductDetailDao.selectList(new QueryWrapper<InvProductDetailEntity>()
.select("id", "code", "relId", "batchNo")
.eq("deptCode", deptCode)
.eq("invCode", bindInvSpaceRequest.getInvCode())
.in("code", bindInvSpaceRequest.getCodeArray())
);
}
if (CollUtil.isNotEmpty(list)) {
List<Integer> ids = list.stream().map(InvProductDetailEntity::getId).collect(Collectors.toList());
log.info("本次绑定货位的库存详情数量为:{} 条", ids.size());
invProductDetailDao.batchBindSpace(ids, bindInvSpaceRequest.getInvSpaceCode());
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
invPreInProductDetailDao.batchBindSpace(ids, bindInvSpaceRequest.getInvSpaceCode());
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) {
invPreProductDetailDao.batchBindSpace(ids, bindInvSpaceRequest.getInvSpaceCode());
} else {
invProductDetailDao.batchBindSpace(ids, bindInvSpaceRequest.getInvSpaceCode());
}
//添加物资上架记录
AddInvPlaceOrderRequest addInvPlaceOrderRequest = new AddInvPlaceOrderRequest();
@ -75,8 +131,10 @@ public class InvPlaceServiceImpl implements InvPlaceService {
addInvPlaceOrderRequest.setInvCode(bindInvSpaceRequest.getInvCode());
addInvPlaceOrderRequest.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode());
invPlaceOrderService.addInvPlaceOrder(addInvPlaceOrderRequest);
return ResultVOUtils.success("绑定成功!本次绑定货位的库存详情数量为:" + ids.size() + "条");
} else {
log.info("绑定货位列表查询无数据");
return ResultVOUtils.error(500, "绑定货位列表查询无数据");
}
}
@ -99,7 +157,15 @@ public class InvPlaceServiceImpl implements InvPlaceService {
@Override
public List<InvPlaceDetailResponse> getInvProductInfo(FilterInvPlaceRequest filterInvPlaceRequest) {
return invProductDetailDao.getInvProductInfo(filterInvPlaceRequest);
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOne(new QueryWrapper<InvWarehouseEntity>().eq("code", filterInvPlaceRequest.getInvCode()));
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
return invPreInProductDetailDao.getInvProductInfo(filterInvPlaceRequest);
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) {
return invPreProductDetailDao.getInvProductInfo(filterInvPlaceRequest);
} else
return invProductDetailDao.getInvProductInfo(filterInvPlaceRequest);
}
@Override

@ -11,6 +11,7 @@ import com.glxp.api.dao.basic.UdiProductDao;
import com.glxp.api.dao.inout.IoOrderDao;
import com.glxp.api.dao.inv.InvPreInProductDetailDao;
import com.glxp.api.dao.inv.InvPreProductDetailDao;
import com.glxp.api.entity.auth.InvSpace;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.inv.InvPreInProductDetailEntity;
@ -18,6 +19,7 @@ import com.glxp.api.entity.inv.InvPreinDetailEntity;
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.res.inv.InvPreProductDetailResponse;
import com.glxp.api.service.auth.InvSpaceService;
import com.glxp.api.service.inv.InvPreProductDetailService;
import com.glxp.api.service.inv.InvPreinProductDetailService;
import com.glxp.api.util.DateUtil;
@ -115,6 +117,9 @@ public class InvPreInProductDetailServiceImpl implements InvPreinProductDetailSe
return invPreInProductDetailDao.filterPreProductDetailList(invPreProductDetailRequest);
}
@Resource
InvSpaceService invSpaceService;
@Override
public void setOrderInfo(InvPreProductDetailResponse response) {
//查询DI层级根据DI层级设置数量取值
@ -139,6 +144,11 @@ public class InvPreInProductDetailServiceImpl implements InvPreinProductDetailSe
response.setInCount(response.getCount());
}
}
InvSpace invSpace = invSpaceService.findByCode(response.getInvCode(), response.getInvSpaceCode());
if (invSpace != null)
response.setInvSpaceName(invSpace.getName());
//设置单据类型名称
BasicBussinessTypeEntity busType = bussinessTypeDao.selectOne(new QueryWrapper<BasicBussinessTypeEntity>().select("name").eq("action", response.getAction()));
response.setActionName(busType.getName());

@ -10,6 +10,7 @@ import com.glxp.api.dao.basic.BasicBussinessTypeDao;
import com.glxp.api.dao.basic.UdiProductDao;
import com.glxp.api.dao.inout.IoOrderDao;
import com.glxp.api.dao.inv.InvPreProductDetailDao;
import com.glxp.api.entity.auth.InvSpace;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.inv.InvPreInProductDetailEntity;
@ -19,6 +20,7 @@ import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.inv.InvPreProductDetailResponse;
import com.glxp.api.service.auth.InvSpaceService;
import com.glxp.api.service.inv.InvPreProductDetailService;
import com.glxp.api.util.DateUtil;
import lombok.extern.slf4j.Slf4j;
@ -109,6 +111,10 @@ public class InvPreProductDetailServiceImpl implements InvPreProductDetailServic
return invPreProductDetailDao.filterPreProductDetailList(invPreProductDetailRequest);
}
@Resource
InvSpaceService invSpaceService;
@Override
public void setOrderInfo(InvPreProductDetailResponse response) {
//查询DI层级根据DI层级设置数量取值
@ -133,6 +139,11 @@ public class InvPreProductDetailServiceImpl implements InvPreProductDetailServic
response.setInCount(response.getCount());
}
}
InvSpace invSpace = invSpaceService.findByCode(response.getInvCode(), response.getInvSpaceCode());
if (invSpace != null)
response.setInvSpaceName(invSpace.getName());
//设置单据类型名称
BasicBussinessTypeEntity busType = bussinessTypeDao.selectOne(new QueryWrapper<BasicBussinessTypeEntity>().select("name").eq("action", response.getAction()));
response.setActionName(busType.getName());

@ -5,15 +5,18 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.constant.ConstantType;
import com.glxp.api.dao.auth.InvSpaceDao;
import com.glxp.api.dao.basic.BasicBussinessTypeDao;
import com.glxp.api.dao.basic.UdiProductDao;
import com.glxp.api.dao.inout.IoOrderDao;
import com.glxp.api.dao.inv.InvProductDetailDao;
import com.glxp.api.entity.auth.InvSpace;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.inv.InvProductDetailEntity;
import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.res.inv.InvProductDetailResponse;
import com.glxp.api.service.auth.InvSpaceService;
import com.glxp.api.service.inv.InvProductDetailService;
import com.glxp.api.util.DateUtil;
import org.springframework.stereotype.Service;
@ -124,6 +127,9 @@ public class InvProductDetailServiceImpl implements InvProductDetailService {
return invProductDetailDao.deleteInvProductDetail(detailRequest);
}
@Resource
InvSpaceService invSpaceService;
@Override
public void setOrderInfo(InvProductDetailResponse response) {
//查询DI层级根据DI层级设置数量取值
@ -148,6 +154,9 @@ public class InvProductDetailServiceImpl implements InvProductDetailService {
response.setInCount(response.getCount());
}
}
InvSpace invSpace = invSpaceService.findByCode(response.getInvCode(), response.getInvSpaceCode());
if (invSpace != null)
response.setInvSpaceName(invSpace.getName());
//设置单据类型名称
BasicBussinessTypeEntity busType = bussinessTypeDao.selectOne(new QueryWrapper<BasicBussinessTypeEntity>().select("name").eq("action", response.getAction()));

@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.inv.InvProductDao;
import com.glxp.api.dao.inv.InvProductDetailDao;
import com.glxp.api.entity.inv.InvProductEntity;
import com.glxp.api.req.inv.FilterInvProductRequest;
import com.glxp.api.res.inv.InvProductResponse;
@ -21,6 +22,8 @@ public class InvProductServiceImpl implements InvProductService {
@Resource
InvProductDao invProductDao;
@Resource
InvProductDetailDao invProductDetailDao;
@Override
public int insert(InvProductEntity invProductEntity) {
@ -67,6 +70,18 @@ public class InvProductServiceImpl implements InvProductService {
return invProductDao.filterList(filterInvProductRequest);
}
@Override
public List<InvProductResponse> findGroupBySpace(FilterInvProductRequest filterInvProductRequest) {
if (null == filterInvProductRequest) {
return Collections.emptyList();
}
if (null != filterInvProductRequest.getPage() && null != filterInvProductRequest.getLimit()) {
PageHelper.offsetPage((filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit(), filterInvProductRequest.getLimit());
}
return invProductDetailDao.findGroupBySpace(filterInvProductRequest);
}
@Override
public InvProductEntity findById(String id) {
return invProductDao.selectById(id);

@ -160,6 +160,14 @@ public class HeartService {
logs = logs + "单据条码信息:" + spsSyncOrderResponse.getCodeEntities().size() + "条\n";
basicExportStatusEntity1.setRemark(logs);
basicExportStatusEntity1.setUpdateTime(new Date());
try {
String fileFullPath = writeFile(filePrefix, NEW_ALL_ORDER, JsonUtils.toJsonString(spsSyncOrderResponse));
basicExportStatusEntity1.setCacheFilePath(fileFullPath);
} catch (IOException e) {
throw new RuntimeException(e);
}
basicExportService.updateExportStatus(basicExportStatusEntity1);
return ResultVOUtils.success();
}
@ -247,7 +255,7 @@ public class HeartService {
}
break;
case USER_DATA:
if (!needExec(info.getBasicDept(), info.getBasicInv(), info.getSysUser())) {
if (needExec(info.getBasicDept(), info.getBasicInv(), info.getSysUser())) {
uploadData(exportType, taskId, x -> x.getUserData(info, taskId, now, syncTime));
}
break;
@ -273,6 +281,7 @@ public class HeartService {
* @return
*/
public SpsSyncBasicDataResponse getBasicData(SyncDataSetEntity info, String taskId, Date now, Date syncTime) {
StringBuffer remark = new StringBuffer();
SpsSyncBasicDataResponse dataResponse = null;
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true);
@ -293,6 +302,7 @@ public class HeartService {
if (CollectionUtil.isNotEmpty(hospTypeList)) {
dataResponse = new SpsSyncBasicDataResponse();
dataResponse.setHospTypeList(hospTypeList);
remark.append("物资字典分类信息:").append(hospTypeList.size()).append("条\n");
}
List<UdiRelevanceEntity> udiRelevanceList = udiRelevanceDao.selectList(Wrappers.lambdaQuery(UdiRelevanceEntity.class)
.le((boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime, now)
@ -304,6 +314,7 @@ public class HeartService {
dataResponse = new SpsSyncBasicDataResponse();
}
dataResponse.setUdiRelevanceList(udiRelevanceList);
remark.append("物资字典主表信息:").append(udiRelevanceList.size()).append("条\n");
}
List<BasicProductsEntity> productsList = basicProductsDao.selectList(Wrappers.lambdaQuery(BasicProductsEntity.class)
.le((boolean) map.get("isNew"), BasicProductsEntity::getUpdateTime, now)
@ -315,6 +326,7 @@ public class HeartService {
dataResponse = new SpsSyncBasicDataResponse();
}
dataResponse.setProductsList(productsList);
remark.append("物资字典字表信息:").append(udiRelevanceList.size()).append("条\n");
}
List<CompanyProductRelevanceEntity> relevanceList = relevanceDao.selectList(Wrappers.lambdaQuery(CompanyProductRelevanceEntity.class)
.le((boolean) map.get("isNew"), CompanyProductRelevanceEntity::getUpdateTime, now)
@ -326,6 +338,7 @@ public class HeartService {
dataResponse = new SpsSyncBasicDataResponse();
}
dataResponse.setRelevanceList(relevanceList);
remark.append("供应商物资字典信息:").append(relevanceList.size()).append("条\n");
}
}
//确认有开启往来单位字典同步
@ -346,6 +359,7 @@ public class HeartService {
dataResponse = new SpsSyncBasicDataResponse();
}
dataResponse.setCorpList(corpList);
remark.append("往来单位信息:").append(corpList.size()).append("条\n");
}
}
@ -367,6 +381,7 @@ public class HeartService {
dataResponse = new SpsSyncBasicDataResponse();
}
dataResponse.setSupCertList(supCertList);
remark.append("资质证书信息:").append(supCertList.size()).append("条\n");
}
List<SupCertSetEntity> supCertSetList = supCertSetDao.selectList(Wrappers.lambdaQuery(SupCertSetEntity.class)
.le((boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime, now)
@ -378,6 +393,7 @@ public class HeartService {
dataResponse = new SpsSyncBasicDataResponse();
}
dataResponse.setSupCertSetList(supCertSetList);
remark.append("资质证书要求设置信息:").append(supCertSetList.size()).append("条\n");
}
List<SupCompanyEntity> supCompanyList = supCompanyDao.selectList(Wrappers.lambdaQuery(SupCompanyEntity.class)
.le((boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime, now)
@ -389,6 +405,7 @@ public class HeartService {
dataResponse = new SpsSyncBasicDataResponse();
}
dataResponse.setSupCompanyList(supCompanyList);
remark.append("供应商资质信息:").append(supCompanyList.size()).append("条\n");
}
List<SupManufacturerEntity> supManufacturerList = supManufacturerDao.selectList(Wrappers.lambdaQuery(SupManufacturerEntity.class)
.le((boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime, now)
@ -400,6 +417,7 @@ public class HeartService {
dataResponse = new SpsSyncBasicDataResponse();
}
dataResponse.setSupManufacturerList(supManufacturerList);
remark.append("生产企业资质信息:").append(supManufacturerList.size()).append("条\n");
}
List<SupProductEntity> supProductList = supProductDao.selectList(Wrappers.lambdaQuery(SupProductEntity.class)
.le((boolean) map.get("isNew"), SupProductEntity::getUpdateTime, now)
@ -411,12 +429,14 @@ public class HeartService {
dataResponse = new SpsSyncBasicDataResponse();
}
dataResponse.setSupProductList(supProductList);
remark.append("配送产品资质信息:").append(supProductList.size()).append("条\n");
}
}
if (dataResponse != null) {
dataResponse.setTaskId(taskId);
dataResponse.setType(BasicExportTypeEnum.BASIC_DATA.getRemark());
dataResponse.setSyncRemark(remark.toString());
}
return dataResponse;
@ -432,7 +452,7 @@ public class HeartService {
* @return
*/
public SpsSyncOtherDataResponse getOtherData(SyncDataSetEntity info, String taskId, Date now, Date syncTime) {
StringBuffer remark = new StringBuffer();
SpsSyncOtherDataResponse dataResponse = null;
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true);
@ -453,6 +473,7 @@ public class HeartService {
if (CollectionUtil.isNotEmpty(ioCodeLostList)) {
dataResponse = new SpsSyncOtherDataResponse();
dataResponse.setIoCodeLostList(ioCodeLostList);
remark.append("UDI码补齐信息").append(ioCodeLostList.size()).append("条\n");
}
}
//确认有开启udi关联关系同步
@ -473,11 +494,13 @@ public class HeartService {
dataResponse = new SpsSyncOtherDataResponse();
}
dataResponse.setIoCodeRelList(ioCodeRelList);
remark.append("UDI码关联关系").append(ioCodeRelList.size()).append("条\n");
}
}
if (dataResponse != null) {
dataResponse.setTaskId(taskId);
dataResponse.setType(BasicExportTypeEnum.OTHER_DATA.getRemark());
dataResponse.setSyncRemark(remark.toString());
}
return dataResponse;
@ -522,9 +545,10 @@ public class HeartService {
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true);
syncTimeMap.put("oldDate", syncTime);
StringBuffer remark = new StringBuffer();
//确认有开启业务单据类型同步
if (needExec(info.getTypeBus())) {
//确认有开启扫码单据类型同步
if (needExec(info.getTypeScan())) {
Map<String, Object> map;
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_BUSSINESS_TYPE);
@ -539,11 +563,11 @@ public class HeartService {
if (CollectionUtil.isNotEmpty(bussinessTypeEntities)) {
dataResponse = new SpsSyncBusResponse();
dataResponse.setBussinessTypeEntities(bussinessTypeEntities);
remark.append("扫码单据类型信息:").append(bussinessTypeEntities.size()).append("条\n");
}
}
//确认有开启扫码单据类型同步
if (needExec(info.getTypeScan())) {
//确认有开启业务单据类型同步
if (needExec(info.getTypeBus())) {
Map<String, Object> map;
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_BUSTYPE_CHANGE);
@ -560,6 +584,7 @@ public class HeartService {
dataResponse = new SpsSyncBusResponse();
}
dataResponse.setBusTypeChangeEntities(busTypeChangeList);
remark.append("业务单据类型:").append(busTypeChangeList.size()).append("条\n");
}
}
@ -581,12 +606,14 @@ public class HeartService {
dataResponse = new SpsSyncBusResponse();
}
dataResponse.setThrBusTypeOriginEntities(thrBusTypeOriginEntities);
remark.append("第三方单据类型信息:").append(thrBusTypeOriginEntities.size()).append("条\n");
}
}
if (dataResponse != null) {
dataResponse.setTaskId(taskId);
dataResponse.setType(BasicExportTypeEnum.DOCUMENT_TYPE_DATA.getRemark());
dataResponse.setSyncRemark(remark.toString());
}
return dataResponse;
@ -614,7 +641,7 @@ public class HeartService {
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true);
syncTimeMap.put("oldDate", syncTime);
StringBuffer remark = new StringBuffer();
//确认有开启部门信息同步
if (needExec(info.getBasicDept())) {
Map<String, Object> map;
@ -631,6 +658,7 @@ public class HeartService {
if (CollectionUtil.isNotEmpty(deptEntityList)) {
dataResponse = new SpsSyncDataResponse();
dataResponse.setDeptEntityList(deptEntityList);
remark.append("部门信息:").append(deptEntityList.size()).append("条\n");
}
List<DeptUserEntity> deptUserEntityList = deptUserService.list(Wrappers.lambdaQuery(DeptUserEntity.class)
.le((boolean) map.get("isNew"), DeptUserEntity::getUpdateTime, now)
@ -642,6 +670,7 @@ public class HeartService {
dataResponse = new SpsSyncDataResponse();
}
dataResponse.setDeptUserEntities(deptUserEntityList);
remark.append("部门用户信息:").append(deptEntityList.size()).append("条\n");
}
}
@ -662,6 +691,7 @@ public class HeartService {
if (dataResponse == null) {
dataResponse = new SpsSyncDataResponse();
}
remark.append("仓库字典信息:").append(warehouseEntityList.size()).append("条\n");
dataResponse.setInvWarehouseEntities(warehouseEntityList);
}
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.list(Wrappers.lambdaQuery(WarehouseUserEntity.class)
@ -673,6 +703,7 @@ public class HeartService {
if (dataResponse == null) {
dataResponse = new SpsSyncDataResponse();
}
remark.append("仓库用户信息:").append(warehouseUserEntities.size()).append("条\n");
dataResponse.setWarehouseUserEntities(warehouseUserEntities);
}
List<WarehouseBussinessTypeEntity> warehouseBussinessTypeEntities = warehouseBussinessTypeService.list(Wrappers.lambdaQuery(WarehouseBussinessTypeEntity.class)
@ -685,6 +716,7 @@ public class HeartService {
dataResponse = new SpsSyncDataResponse();
}
dataResponse.setWarehouseBussinessTypeEntities(warehouseBussinessTypeEntities);
remark.append("仓库单据类型信息:").append(warehouseBussinessTypeEntities.size()).append("条\n");
}
List<InvSpace> invSpaceList = invSpaceService.list(Wrappers.lambdaQuery(InvSpace.class)
.le((boolean) map.get("isNew"), InvSpace::getUpdateTime, now)
@ -696,6 +728,7 @@ public class HeartService {
dataResponse = new SpsSyncDataResponse();
}
dataResponse.setInvSpaces(invSpaceList);
remark.append("货位信息:").append(invSpaceList.size()).append("条\n");
}
}
@ -717,6 +750,7 @@ public class HeartService {
dataResponse = new SpsSyncDataResponse();
}
dataResponse.setAuthAdminList(adminList);
remark.append("系统用户信息:").append(adminList.size()).append("条\n");
}
List<InvBusUserEntity> busUserEntities = invBusUserService.list(Wrappers.lambdaQuery(InvBusUserEntity.class)
.le((boolean) map.get("isNew"), InvBusUserEntity::getUpdateTime, now)
@ -728,12 +762,14 @@ public class HeartService {
dataResponse = new SpsSyncDataResponse();
}
dataResponse.setInvBusUserEntities(busUserEntities);
remark.append("用户关联单据信息:").append(busUserEntities.size()).append("条\n");
}
}
if (dataResponse != null) {
dataResponse.setTaskId(taskId);
dataResponse.setType(BasicExportTypeEnum.USER_DATA.getRemark());
dataResponse.setSyncRemark(remark.toString());
}
return dataResponse;
}
@ -756,7 +792,7 @@ public class HeartService {
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true);
syncTimeMap.put("oldDate", syncTime);
StringBuffer remark = new StringBuffer();
//确认有开启第三方部门信息同步
if (needExec(info.getBasicThirdDept())) {
Map<String, Object> map;
@ -773,6 +809,7 @@ public class HeartService {
if (CollectionUtil.isNotEmpty(deptEntityList)) {
dataResponse = new SpsSyncThrDataResponse();
dataResponse.setDeptEntities(deptEntityList);
remark.append("第三方部门信息:").append(deptEntityList.size()).append("条\n");
}
}
@ -794,6 +831,7 @@ public class HeartService {
dataResponse = new SpsSyncThrDataResponse();
}
dataResponse.setInvWarehouseEntities(warehouseEntityList);
remark.append("第三方仓库信息:").append(warehouseEntityList.size()).append("条\n");
}
}
@ -815,6 +853,7 @@ public class HeartService {
dataResponse = new SpsSyncThrDataResponse();
}
dataResponse.setProductsEntityList(productsEntityList);
remark.append("第三方产品信息:").append(productsEntityList.size()).append("条\n");
}
}
@ -836,12 +875,14 @@ public class HeartService {
dataResponse = new SpsSyncThrDataResponse();
}
dataResponse.setCorpEntities(corpEntities);
remark.append("第三方往来信息:").append(corpEntities.size()).append("条\n");
}
}
if (dataResponse != null) {
dataResponse.setTaskId(taskId);
dataResponse.setType(BasicExportTypeEnum.THIRD_DATA.getRemark());
dataResponse.setSyncRemark(remark.toString());
}
return dataResponse;
}
@ -871,6 +912,7 @@ public class HeartService {
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true);
syncTimeMap.put("oldDate", syncTime);
StringBuffer remark = new StringBuffer();
if (needExec(info.getSystemConfig())) {
Map<String, Object> map;
if (syncTime == null) {
@ -886,6 +928,7 @@ public class HeartService {
if (CollectionUtil.isNotEmpty(systemParamConfigEntities)) {
dataResponse = new SpsSyncSysSettingResponse();
dataResponse.setSystemParamConfigEntities(systemParamConfigEntities);
remark.append("运行参数设置信息:").append(systemParamConfigEntities.size()).append("条\n");
}
}
if (needExec(info.getEntrustAction())) {
@ -905,6 +948,7 @@ public class HeartService {
dataResponse = new SpsSyncSysSettingResponse();
}
dataResponse.setEntrustReceEntities(entrustReceEntities);
remark.append("委托验收设置信息:").append(entrustReceEntities.size()).append("条\n");
}
}
if (needExec(info.getPrintConfig())) {
@ -924,6 +968,7 @@ public class HeartService {
dataResponse = new SpsSyncSysSettingResponse();
}
dataResponse.setSystemPDFModuleEntities(systemPDFModuleEntities);
remark.append("系统模板模块信息:").append(systemPDFModuleEntities.size()).append("条\n");
}
List<SystemPDFTemplateEntity> systemPDFTemplateEntities = systemPDFTemplateService.list(Wrappers.lambdaQuery(SystemPDFTemplateEntity.class)
@ -936,6 +981,7 @@ public class HeartService {
dataResponse = new SpsSyncSysSettingResponse();
}
dataResponse.setSystemPDFTemplateEntities(systemPDFTemplateEntities);
remark.append("模板信息:").append(systemPDFTemplateEntities.size()).append("条\n");
}
List<SysPdfTemplateRelevanceCodeEntity> sysPdfTemplateRelevanceCodeEntities = systemPDFTemplateRelevanceCodeService.list(Wrappers.lambdaQuery(SysPdfTemplateRelevanceCodeEntity.class)
@ -948,6 +994,7 @@ public class HeartService {
dataResponse = new SpsSyncSysSettingResponse();
}
dataResponse.setSysPdfTemplateRelevanceCodeEntities(sysPdfTemplateRelevanceCodeEntities);
remark.append("扫码单据关联模板信息:").append(sysPdfTemplateRelevanceCodeEntities.size()).append("条\n");
}
List<SysPdfTemplateRelevanceBizEntity> sysPdfTemplateRelevanceBizEntities = systemPDFTemplateRelevanceBizService.list(Wrappers.lambdaQuery(SysPdfTemplateRelevanceBizEntity.class)
@ -960,6 +1007,7 @@ public class HeartService {
dataResponse = new SpsSyncSysSettingResponse();
}
dataResponse.setSysPdfTemplateRelevanceBizEntities(sysPdfTemplateRelevanceBizEntities);
remark.append("业务单据关联模板信息:").append(sysPdfTemplateRelevanceBizEntities.size()).append("条\n");
}
List<SysPdfTemplateRelevanceLabelEntity> sysPdfTemplateRelevanceLabelEntities = systemPDFTemplateRelevanceLabelService.list(Wrappers.lambdaQuery(SysPdfTemplateRelevanceLabelEntity.class)
@ -972,6 +1020,7 @@ public class HeartService {
dataResponse = new SpsSyncSysSettingResponse();
}
dataResponse.setSysPdfTemplateRelevanceLabelEntities(sysPdfTemplateRelevanceLabelEntities);
remark.append("标签关联模板信息:").append(sysPdfTemplateRelevanceLabelEntities.size()).append("条\n");
}
List<SysPdfTemplateRelevanceStatemenEntity> sysPdfTemplateRelevanceStatemenEntities = systemPDFTemplateRelevanceStatemenService.list(Wrappers.lambdaQuery(SysPdfTemplateRelevanceStatemenEntity.class)
@ -984,6 +1033,7 @@ public class HeartService {
dataResponse = new SpsSyncSysSettingResponse();
}
dataResponse.setSysPdfTemplateRelevanceStatemenEntities(sysPdfTemplateRelevanceStatemenEntities);
remark.append("报表关联模板信息:").append(sysPdfTemplateRelevanceStatemenEntities.size()).append("条\n");
}
}
@ -1002,6 +1052,7 @@ public class HeartService {
if (CollectionUtil.isNotEmpty(basicBusTypePreEntities)) {
dataResponse = new SpsSyncSysSettingResponse();
dataResponse.setBasicBusTypePreEntities(basicBusTypePreEntities);
remark.append("出入库单自动补单设置信息:").append(basicBusTypePreEntities.size()).append("条\n");
}
}
if (needExec(info.getBusChangeConfig())) {
@ -1019,12 +1070,14 @@ public class HeartService {
if (CollectionUtil.isNotEmpty(basicBusTypeChangeEntities)) {
dataResponse = new SpsSyncSysSettingResponse();
dataResponse.setBasicBusTypeChangeEntities(basicBusTypeChangeEntities);
remark.append("业务单自动补单设置信息:").append(basicBusTypeChangeEntities.size()).append("条\n");
}
}
if (dataResponse != null) {
dataResponse.setTaskId(taskId);
dataResponse.setType(BasicExportTypeEnum.SYS_SET_DATA.getRemark());
dataResponse.setSyncRemark(remark.toString());
if (CollUtil.isNotEmpty(dataResponse.getSystemPDFTemplateEntities())) {
// List<Map<String, String>> list = new ArrayList<>(spsSyncSysSettingResponse.getSystemPDFTemplateEntities().size() * 2);
List<String> list = new ArrayList<>();
@ -1068,6 +1121,9 @@ public class HeartService {
if (baseResponse.getCode() != 20000) {
status = StatusEnum.FAILED.getCode();
}
BaseSyncResponse baseSyncResponse = (BaseSyncResponse) data;
BasicExportStatusEntity exportStatus = BasicExportStatusEntity.builder()
.id(taskId)
.status(status)
@ -1076,9 +1132,9 @@ public class HeartService {
.startTime(new Date())
.endTime(new Date())
.updateTime(new Date())
.receiveStatus(status)
.receiveStatus(status + "")
.scheduleType(BasicProcessStatus.SCHEDULE_NORMAL)
.remark(baseResponse.getMessage())
.remark(baseSyncResponse.getSyncRemark())
.build();
try {
String fileFullPath = writeFile(filePrefix, exportType.getRemark(), JsonUtils.toJsonString(data));
@ -1284,7 +1340,7 @@ public class HeartService {
//下载最近更新扫码单据--上级服务
@Transactional(propagation = Propagation.NESTED)
public void dlAllOrder() {
BaseResponse<List<BasicExportStatusEntity>> baseResponse = spGetHttp.getBasicStatus(NEW_ALL_ORDER + "");
BaseResponse<List<BasicExportStatusEntity>> baseResponse = spGetHttp.getBasicStatus(NEW_ALL_ORDER + "", "3");
List<BasicExportStatusEntity> pageSimpleResponse = baseResponse != null ? baseResponse.getData() : new ArrayList<>();
if (pageSimpleResponse != null) {
List<BasicExportStatusEntity> basicExportStatusEntities = pageSimpleResponse;
@ -1304,9 +1360,9 @@ public class HeartService {
basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER);
basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中
basicDownloadStatusEntity.setType(NEW_ALL_ORDER);
basicDownloadStatusEntity.setRemark(syncDataResponse.getSyncRemark());
basicDownloadStatusEntity.setScheduleType(1);
basicDownloadService.insertDownloadStatus(basicDownloadStatusEntity);
StringBuffer remark = new StringBuffer();
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities())) {
try {
@ -1314,6 +1370,7 @@ public class HeartService {
for (IoOrderEntity orderEntity : orderEntities) {
orderEntity.setUpdateTime(null);
orderEntity.setFromType(ConstantStatus.FROM_UDISP);
orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
IoOrderEntity temp = orderService.findByBillNo(orderEntity.getBillNo());
if (temp == null) {
@ -1329,29 +1386,15 @@ public class HeartService {
}
}
String logs = "";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities()))
logs = logs + "单据:" + syncDataResponse.getOrderEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailBizEntities()))
logs = logs + "业务详情:" + syncDataResponse.getOrderDetailBizEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities()))
logs = logs + "单据扫码详情:" + syncDataResponse.getOrderDetailCodeEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailResultEntities()))
logs = logs + "单据结果详情:" + syncDataResponse.getOrderDetailResultEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getCodeEntities()))
logs = logs + "单据条码信息:" + syncDataResponse.getCodeEntities().size() + "条\n";
remark.append(logs);
} catch (Exception e) {
e.printStackTrace();
}
}
spGetHttp.postBasicStatus(basicExportStatusEntity.getId());
spGetHttp.finishTask(basicExportStatusEntity.getId());
basicDownloadStatusEntity.setUpdateTime(new Date());
basicDownloadStatusEntity.setEndTime(new Date());
basicDownloadStatusEntity.setRemark(remark.toString());
basicDownloadStatusEntity.setStatus(StatusEnum.SUCCESS.getCode());
basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity);
@ -1365,7 +1408,7 @@ public class HeartService {
// 下载最近更新国家库数据-上级服务
@Transactional(propagation = Propagation.NESTED)
public void dlAllDiProducts() {
BaseResponse<List<BasicExportStatusEntity>> baseResponse = spGetHttp.getBasicStatus(NEW_ALL_UDIS);
BaseResponse<List<BasicExportStatusEntity>> baseResponse = spGetHttp.getBasicStatus(NEW_ALL_UDIS, "3");
List<BasicExportStatusEntity> pageSimpleResponse = baseResponse.getData();
if (pageSimpleResponse != null) {
List<BasicExportStatusEntity> basicExportStatusEntities = pageSimpleResponse;
@ -1414,11 +1457,17 @@ public class HeartService {
remark.append("产品信息:").append(spSyncUdiResponse.getProductInfoEntityList().size()).append("条\n");
}
batchSession.close();
spGetHttp.postBasicStatus(basicExportStatusEntity.getId());
// spGetHttp.postBasicStatus(basicExportStatusEntity.getId());
spGetHttp.finishTask(basicExportStatusEntity.getId());
basicDownloadStatusEntity.setUpdateTime(new Date());
basicDownloadStatusEntity.setEndTime(new Date());
basicDownloadStatusEntity.setRemark(remark.toString());
try {
String fileFullPath = writeFile(filePrefix, NEW_ALL_UDIS, JSONUtil.toJsonStr(response.getData()));
basicDownloadStatusEntity.setCacheFilePath(fileFullPath);
} catch (IOException e) {
throw new RuntimeException(e);
}
basicDownloadStatusEntity.setStatus(StatusEnum.SUCCESS.getCode());
basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity);
}
@ -1476,6 +1525,8 @@ public class HeartService {
String taskId = bean.getTaskId();
if (StrUtil.isNotBlank(taskId)) {
//插入下载记录
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(bean.getFileContent());
String remark = jsonObject.getStr(Constant.SYNC_REMARK);
BasicDownloadStatusEntity basicDownloadStatusEntity = new BasicDownloadStatusEntity();
basicDownloadStatusEntity.setId(CustomUtil.getId());
basicDownloadStatusEntity.setTaskId(taskId);
@ -1483,6 +1534,7 @@ public class HeartService {
basicDownloadStatusEntity.setUpdateTime(new Date());
basicDownloadStatusEntity.setEndTime(new Date());
basicDownloadStatusEntity.setIdDatas(exportType.getKey());
basicDownloadStatusEntity.setRemark(remark);
basicDownloadStatusEntity.setStatus(StatusEnum.SUCCESS.getCode()); //下载完成
basicDownloadStatusEntity.setType(exportType.getRemark());
basicDownloadStatusEntity.setScheduleType(1);
@ -1781,6 +1833,7 @@ public class HeartService {
List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities();
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
orderInvoiceEntity.setId(null);
orderInvoiceService.insertInvoice(orderInvoiceEntity);
}
}

@ -60,7 +60,7 @@ public class SyncHeartTask implements SchedulingConfigurer {
//定时上传最近更新基础数据至上游轮询时间
long timeInterval1 = syncDataSetEntity.getSyncTime() * 60 * 1000L;
long timeInterval1 = syncDataSetEntity.getSyncTime() * 6 * 1000L;
long curTime1 = System.currentTimeMillis();
Long lastTime1 = (Long) redisUtil.get("SPS_SYNC_UPLOAD_DATA");
if (lastTime1 == null) {
@ -86,7 +86,7 @@ public class SyncHeartTask implements SchedulingConfigurer {
//定时上传最近更新单据数据至上游轮询时间
long timeInterval2 = syncDataSetEntity.getOrderSyncTime() * 60 * 1000L;
long timeInterval2 = syncDataSetEntity.getOrderSyncTime() * 6 * 1000L;
long curTime2 = System.currentTimeMillis();
Long lastTime2 = (Long) redisUtil.get("SPS_SYNC_UPLOAD_ORDER");
if (lastTime2 == null) {

@ -1,6 +1,6 @@
spring:
profiles:
active: test
active: dev
jmx:
enabled: false
servlet:

@ -47,9 +47,9 @@
<insert id="insertEntity" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.auth.InvSpace"
useGeneratedKeys="true">
insert into auth_space (code, `name`, type, invStorageCode,
invWarehouseCode, `status`, createTime,
updateTime, `createUser`, updateUser,
remark)
invWarehouseCode, `status`, createTime,
updateTime, `createUser`, updateUser,
remark)
values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{invStorageCode,jdbcType=VARCHAR},
#{invWarehouseCode,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
@ -255,9 +255,9 @@
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
insert into auth_space
(code, `name`, type, invStorageCode, invWarehouseCode, `status`, createTime, updateTime,
`createUser`, updateUser, remark)
values
(code, `name`, type, invStorageCode, invWarehouseCode, `status`, createTime, updateTime,
`createUser`, updateUser, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.code,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
#{item.invStorageCode,jdbcType=VARCHAR},
@ -269,13 +269,14 @@
</foreach>
</insert>
<select id="filterList" parameterType="com.glxp.api.req.auth.FilterInvSpaceRequest" resultType="com.glxp.api.res.auth.InvSpaceResponse">
<select id="filterList" parameterType="com.glxp.api.req.auth.FilterInvSpaceRequest"
resultType="com.glxp.api.res.auth.InvSpaceResponse">
select s.*,
w.name invStorageName,
iws.name invSubStorageName
from auth_space s
left join auth_dept w on s.invStorageCode = w.code
left join auth_warehouse iws on s.invWarehouseCode = iws.code
left join auth_dept w on s.invStorageCode = w.code
left join auth_warehouse iws on s.invWarehouseCode = iws.code
<where>
<if test="invStorageCode != null and invStorageCode != ''">
AND s.invStorageCode = #{invStorageCode}
@ -318,8 +319,8 @@
<select id="selectSpaceCodeList" resultType="com.glxp.api.res.auth.InvSpaceResponse">
select auth_space.code, auth_space.name, iws.name invSubStorageName, iw.name invStorageName
from auth_space
left join auth_warehouse iws on iws.code = auth_space.invWarehouseCode
left join auth_dept iw on iw.code = auth_space.invStorageCode
left join auth_warehouse iws on iws.code = auth_space.invWarehouseCode
left join auth_dept iw on iw.code = auth_space.invStorageCode
<where>
<if test="invStorageCode != null and invStorageCode != ''">
AND auth_space.invStorageCode = #{invStorageCode}
@ -385,7 +386,7 @@
<select id="selectExistByName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from auth_space
<where>
<if test="invStorageCode != null and invStorageCode != ''">
@ -401,7 +402,8 @@
</select>
<select id="getMaxSpaceCode" resultType="java.lang.String">
select max(code) from auth_space
select max(code)
from auth_space
<where>
<if test="invCode != null and invCode != ''">
and invWarehouseCode = #{invCode}

@ -38,11 +38,11 @@
a4.name
thirdName4
from auth_warehouse
LEFT JOIN thr_inv_warehouse a on a.code = auth_warehouse.thirdId
LEFT JOIN thr_inv_warehouse a1 on a1.code = auth_warehouse.thirdId1
LEFT JOIN thr_inv_warehouse a2 on a2.code = auth_warehouse.thirdId2
LEFT JOIN thr_inv_warehouse a3 on a3.code = auth_warehouse.thirdId3
LEFT JOIN thr_inv_warehouse a4 on a4.code = auth_warehouse.thirdId4
LEFT JOIN thr_inv_warehouse a on a.code = auth_warehouse.thirdId
LEFT JOIN thr_inv_warehouse a1 on a1.code = auth_warehouse.thirdId1
LEFT JOIN thr_inv_warehouse a2 on a2.code = auth_warehouse.thirdId2
LEFT JOIN thr_inv_warehouse a3 on a3.code = auth_warehouse.thirdId3
LEFT JOIN thr_inv_warehouse a4 on a4.code = auth_warehouse.thirdId4
<where>
<if test="code != '' and code != null">
AND auth_warehouse.code = #{code}
@ -57,13 +57,13 @@
limit 1
</select>
<select id="getByWareId" resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
<select id="getByWareId" resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
select *
FROM auth_warehouse
WHERE id = #{id}
</select>
<select id="getByWarePcode" resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
<select id="getByWarePcode" resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
select *
FROM auth_warehouse
WHERE parentCode = #{parentCode}
@ -73,9 +73,9 @@
<select id="filterGroupInvSub" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest"
resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
select auth_warehouse.*, auth_dept.`name` AS warehouseName from auth_warehouse
INNER JOIN
auth_dept
on auth_warehouse.parentId = auth_dept.code
INNER JOIN
auth_dept
on auth_warehouse.parentId = auth_dept.code
<if test="userId != '' and userId != null">
INNER JOIN auth_warehouse_user on auth_warehouse.code = auth_warehouse_user.code
</if>
@ -100,7 +100,7 @@
</if>
<if test="superiorCode != '' and superiorCode != null">
AND (auth_dept.code = #{superiorPcode}
OR auth_dept.pcode = #{superiorCode})
OR auth_dept.pcode = #{superiorCode})
</if>
<if test="subordinateCode != '' and subordinateCode != null">
AND auth_dept.pcode = #{subordinateCode}
@ -145,23 +145,23 @@
<insert id="insertInvSubWarehouse" keyProperty="id"
parameterType="com.glxp.api.entity.auth.InvWarehouseEntity">
replace
INTO auth_warehouse
( id, code, `name`, parentId, remark, defaultInv, advanceType, spUse,parentCode
INTO auth_warehouse
( id, code, `name`, parentId, remark, defaultInv, advanceType, spUse, parentCode
, thirdId, thirdId1, thirdId2, thirdId3, thirdId4)
values (#{id},
#{code},
#{name},
#{parentId},
#{remark},
#{defaultInv},
#{advanceType},
#{spUse},
#{parentCode},
#{thirdId},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4})
#{code},
#{name},
#{parentId},
#{remark},
#{defaultInv},
#{advanceType},
#{spUse},
#{parentCode},
#{thirdId},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4})
</insert>
@ -226,10 +226,11 @@
<insert id="importInvSubWarehouse" parameterType="java.util.List">
replace
into auth_warehouse
(id, code, `name`, parentId, remark, defaultInv, parentCode, advanceType, thirdId, thirdId1, thirdId2, thirdId3,
thirdId4)
values
into auth_warehouse
(id, code, `name`, parentId, remark, defaultInv, parentCode, advanceType, thirdId, thirdId1, thirdId2,
thirdId3,
thirdId4)
values
<foreach collection="invWarehouseEntities" item="item" index="index" separator=",">
@ -287,8 +288,8 @@
c.name parentInvName,
a.spUse
FROM auth_warehouse a
left join auth_dept b on a.parentId = b.code
left join auth_warehouse c on a.parentCode = c.code
left join auth_dept b on a.parentId = b.code
left join auth_warehouse c on a.parentCode = c.code
<where>
<if test="id != '' and id != null">
AND a.id = #{id}
@ -309,8 +310,8 @@
AND a.advanceType = #{advanceType}
</if>
<if test="key != null and key != ''">
AND (a.name like concat('%', #{key}, '%') or
a.code = #{key})
AND (a.name like concat('%', #{key}, '%') or
a.code = #{key})
</if>
</where>
</select>
@ -319,9 +320,9 @@
resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
select auth_warehouse.*, auth_dept.`name` AS warehouseName
from auth_warehouse
INNER JOIN
auth_dept
on auth_warehouse.parentId = auth_dept.code
INNER JOIN
auth_dept
on auth_warehouse.parentId = auth_dept.code
<where>
<if test="subordinateCode != '' and subordinateCode != null">
AND auth_dept.pcode = #{subordinateCode}
@ -345,8 +346,8 @@
b.name parentName,
a.parentCode
from auth_warehouse a
left join auth_dept b on a.parentId = b.code
left join auth_warehouse_user c on a.code = c.code
left join auth_dept b on a.parentId = b.code
left join auth_warehouse_user c on a.code = c.code
<where>
<if test="userId != null">
AND c.userId = #{userId}
@ -368,8 +369,8 @@
auth_warehouse.parentCode,
auth_dept.name warehouseName
from auth_warehouse
inner join auth_dept on auth_warehouse.parentId = auth_dept.code
LEFT join auth_warehouse_user on auth_warehouse.code = auth_warehouse_user.code
inner join auth_dept on auth_warehouse.parentId = auth_dept.code
LEFT join auth_warehouse_user on auth_warehouse.code = auth_warehouse_user.code
<where>
<if test="userId != null">
AND auth_warehouse_user.userId = #{userId}
@ -405,12 +406,18 @@
</where>
</select>
<select id="selectLowWarehouseAll" parameterType="java.lang.String" resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
<select id="selectLowWarehouseAll" parameterType="java.lang.String"
resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
with recursive table_a as (
select * from auth_warehouse ta where parentCode = #{pcode}
union all
select tb.* from auth_warehouse tb inner join table_a on table_a.code = tb.parentCode
)
select * from table_a
select *
from auth_warehouse ta
where parentCode = #{pcode}
union all
select tb.*
from auth_warehouse tb
inner join table_a on table_a.code = tb.parentCode
)
select *
from table_a
</select>
</mapper>

@ -2,19 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.basic.ProductInfoDao">
<select id="filterProductInfo" parameterType="com.glxp.api.req.basic.ProductInfoFilterRequest"
resultType="com.glxp.api.entity.basic.ProductInfoEntity">
SELECT * FROM productinfo
SELECT *
FROM productinfo
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
@ -23,31 +23,31 @@
AND deviceRecordKey = #{deviceRecordKey}
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat(#{ggxh},'%')
AND ggxh LIKE concat(#{ggxh}, '%')
</if>
<if test="tyshxydm != '' and tyshxydm != null">
AND tyshxydm = #{tyshxydm}
</if>
<if test="updateTime!=null and updateTime!=''">
<![CDATA[ and updateTime>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="updateTime != null and updateTime != ''">
<![CDATA[
and updateTime >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<select id="filterProductGroup" parameterType="com.glxp.api.req.basic.ProductInfoFilterRequest"
resultType="com.glxp.api.entity.basic.ProductInfoEntity">
SELECT * FROM productinfo
SELECT *
FROM productinfo
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
@ -56,13 +56,15 @@
AND deviceRecordKey = #{deviceRecordKey}
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat(#{ggxh},'%')
AND ggxh LIKE concat(#{ggxh}, '%')
</if>
<if test="tyshxydm != '' and tyshxydm != null">
AND tyshxydm = #{tyshxydm}
</if>
<if test="updateTime!=null and updateTime!=''">
<![CDATA[ and updateTime>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="updateTime != null and updateTime != ''">
<![CDATA[
and updateTime >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
GROUP BY uuid
@ -70,22 +72,25 @@
<select id="filterCpmctymc" parameterType="com.glxp.api.req.basic.ProductInfoFilterRequest"
resultType="com.glxp.api.entity.basic.ProductInfoEntity">
select * from productinfo
select *
from productinfo
<where>
<if test="tyshxydm != '' and tyshxydm != null">
AND tyshxydm = #{tyshxydm}
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
<if test="updateTime!=null and updateTime!=''">
<![CDATA[ and updateTime>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="updateTime != null and updateTime != ''">
<![CDATA[
and updateTime >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
GROUP BY cpmctymc
@ -94,23 +99,26 @@
<select id="filterUdiByTyshxydm" parameterType="com.glxp.api.req.basic.ProductInfoFilterRequest"
resultType="com.glxp.api.entity.basic.ProductInfoEntity">
SELECT * FROM productinfo
SELECT *
FROM productinfo
<where>
diType = 1
<if test="tyshxydm != '' and tyshxydm != null">
AND tyshxydm = #{tyshxydm}
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
<if test="updateTime!=null and updateTime!=''">
<![CDATA[ and updateTime>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="updateTime != null and updateTime != ''">
<![CDATA[
and updateTime >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
GROUP BY nameCode
@ -118,8 +126,9 @@
<select id="selectAllByUuid" parameterType="java.util.List"
resultType="com.glxp.api.entity.basic.ProductInfoEntity">
select * from productinfo where
uuid in (
select *
from productinfo where
uuid in (
<foreach collection="ids" item="item" index="index"
separator=",">
#{item}
@ -137,27 +146,27 @@
<!-- CHAR_LENGTH(nameCode) <![CDATA[ >= ]]> 14-->
<select id="filterUdiByCreditNo" parameterType="com.glxp.api.req.basic.ProductInfoFilterRequest"
resultType="com.glxp.api.entity.basic.ProductInfoEntity">
select p.* from productinfo p INNER JOIN
(select deviceRecordKey ,max(versionNumber) versionNumber from productinfo
select p.* from productinfo p
INNER JOIN
(select deviceRecordKey, max(versionNumber) versionNumber
from productinfo
<where>
<if test="tyshxydm != '' and tyshxydm != null">
AND tyshxydm = #{tyshxydm}
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
</where>
GROUP BY deviceRecordKey)
a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
<where>
<if test="diType != '' and diType != null">
AND diType = #{diType}
@ -168,17 +177,17 @@
<select id="filterUdiByNewest" parameterType="com.glxp.api.req.basic.ProductInfoFilterRequest"
resultType="com.glxp.api.entity.basic.ProductInfoEntity">
SELECT * FROM productinfo
SELECT *
FROM productinfo
<where>
<if test="tyshxydm != '' and tyshxydm != null">
AND tyshxydm = #{tyshxydm}
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
@ -191,72 +200,73 @@
<select id="filterUuidByCreditNo" parameterType="com.glxp.api.req.basic.ProductInfoFilterRequest"
resultType="java.lang.String">
select p.uuid from productinfo p INNER JOIN
(select deviceRecordKey ,max(versionNumber) versionNumber from productinfo
select p.uuid from productinfo p
INNER JOIN
(select deviceRecordKey, max(versionNumber) versionNumber
from productinfo
<where>
<if test="tyshxydm != '' and tyshxydm != null">
AND tyshxydm = #{tyshxydm}
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
</where>
GROUP BY deviceRecordKey)
a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
group by uuid
a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
group by uuid
</select>
<select id="filterUdi" parameterType="com.glxp.api.req.basic.ProductInfoFilterRequest"
resultType="com.glxp.api.entity.basic.ProductInfoEntity">
select * from productinfo
select *
from productinfo
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc= #{ylqxzcrbarmc}
AND ylqxzcrbarmc = #{ylqxzcrbarmc}
</if>
<if test="ylqxzcrbarmc == '' and cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null and cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat('%',#{cpmctymc},'%')
AND cpmctymc LIKE concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat('%',#{ggxh},'%')
AND ggxh LIKE concat('%', #{ggxh}, '%')
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat('%',#{zczbhhzbapzbh},'%')
AND zczbhhzbapzbh LIKE concat('%', #{zczbhhzbapzbh}, '%')
</if>
<if test="deviceRecordKey != '' and deviceRecordKey != null">
AND deviceRecordKey = #{deviceRecordKey}
</if>
<if test="updateTime!=null and updateTime!=''">
<![CDATA[ and updateTime>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="updateTime != null and updateTime != ''">
<![CDATA[
and updateTime >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="isNewest != null and isNewest!=''">
<if test="isNewest != null and isNewest != ''">
AND isNewest = #{isNewest}
</if>
<if test="diType != '' and diType != null">
AND diType = #{diType}
</if>
</where>
</select>
@ -368,24 +378,23 @@
<select id="syncDlUdi" parameterType="com.glxp.api.req.basic.ProductInfoFilterRequest"
resultType="com.glxp.api.entity.basic.ProductInfoEntity">
SELECT * FROM productinfo
SELECT *
FROM productinfo
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat('%',#{ggxh},'%')
AND ggxh LIKE concat('%', #{ggxh}, '%')
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh = #{zczbhhzbapzbh}
@ -393,137 +402,133 @@
<if test="deviceRecordKey != '' and deviceRecordKey != null">
AND deviceRecordKey = #{deviceRecordKey}
</if>
<if test="updateTime!=null and updateTime!=''">
<![CDATA[ and updateTime>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="updateTime != null and updateTime != ''">
<![CDATA[
and updateTime >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
limit #{page},#{limit}
</select>
<insert id="insertProductInfo" keyProperty="id"
<insert id="insertProductInfo"
parameterType="com.glxp.api.entity.basic.ProductInfoEntity">
REPLACE
INTO productinfo
(
id,nameCode,packRatio,packLevel,bhxjsl,
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,thirdProductNo,addType,deviceRecordKey,isUseDy,thirdProductName,
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
,diType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,
ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime,cplx,hchzsb
,sfwblztlcp,cgzmraqxgxx,sfbjwycxsy,zdcfsycs,sfwwjbz,syqsfxyjxmj,qtxxdwzlj,mjfs
)
values
(
#{id},
#{nameCode},
#{packRatio},
#{packLevel},
#{bhxjsl},
#{bhzxxsbzsl},
#{zxxsbzbhsydysl},
#{bhxjcpbm},
#{bzcj},
#{thirdProductNo},
#{addType},
#{deviceRecordKey},
#{isUseDy},
#{thirdProductName},
#{cpmctymc},
#{cplb},
#{flbm},
#{ggxh},
#{qxlb},
#{tyshxydm},
#{ylqxzcrbarmc},
#{zczbhhzbapzbh},
#{ylqxzcrbarywmc},
#{uuid},
#{sjcpbm},
#{versionNumber},
#{diType},
#{scbssfbhph},
#{scbssfbhxlh},
#{scbssfbhscrq},
#{scbssfbhsxrq},
#{ybbm},
#{spmc},
#{cphhhbh},
#{cpms},
#{cpbsbmtxmc},
#{isNewest},
#{updateTime},
#{cplx},
#{hchzsb},
#{sfwblztlcp},
#{cgzmraqxgxx},
#{sfbjwycxsy},
#{zdcfsycs},
#{sfwwjbz},
#{syqsfxyjxmj},
#{qtxxdwzlj},
#{mjfs}
)
INTO productinfo
(id, nameCode, packRatio, packLevel, bhxjsl,
bhzxxsbzsl, zxxsbzbhsydysl, bhxjcpbm, bzcj, thirdProductNo, addType, deviceRecordKey, isUseDy,
thirdProductName,
cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm, ylqxzcrbarmc, zczbhhzbapzbh, ylqxzcrbarywmc, uuid, sjcpbm,
versionNumber
, diType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq,
ybbm, spmc, cphhhbh, cpms, cpbsbmtxmc, isNewest, updateTime, cplx, hchzsb
, sfwblztlcp, cgzmraqxgxx, sfbjwycxsy, zdcfsycs, sfwwjbz, syqsfxyjxmj, qtxxdwzlj, mjfs)
values (#{id},
#{nameCode},
#{packRatio},
#{packLevel},
#{bhxjsl},
#{bhzxxsbzsl},
#{zxxsbzbhsydysl},
#{bhxjcpbm},
#{bzcj},
#{thirdProductNo},
#{addType},
#{deviceRecordKey},
#{isUseDy},
#{thirdProductName},
#{cpmctymc},
#{cplb},
#{flbm},
#{ggxh},
#{qxlb},
#{tyshxydm},
#{ylqxzcrbarmc},
#{zczbhhzbapzbh},
#{ylqxzcrbarywmc},
#{uuid},
#{sjcpbm},
#{versionNumber},
#{diType},
#{scbssfbhph},
#{scbssfbhxlh},
#{scbssfbhscrq},
#{scbssfbhsxrq},
#{ybbm},
#{spmc},
#{cphhhbh},
#{cpms},
#{cpbsbmtxmc},
#{isNewest},
#{updateTime},
#{cplx},
#{hchzsb},
#{sfwblztlcp},
#{cgzmraqxgxx},
#{sfbjwycxsy},
#{zdcfsycs},
#{sfwwjbz},
#{syqsfxyjxmj},
#{qtxxdwzlj},
#{mjfs})
</insert>
<insert id="insertProductInfos" keyProperty="id"
parameterType="com.glxp.api.entity.basic.ProductInfoEntity">
REPLACE INTO productinfo
(
id,nameCode,packRatio,packLevel,bhxjsl,
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,thirdProductNo,addType,deviceRecordKey,isUseDy,thirdProductName,
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
,diType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,
ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime,cplx,hchzsb
,sfwblztlcp,cgzmraqxgxx,sfbjwycxsy,zdcfsycs,sfwwjbz,syqsfxyjxmj,qtxxdwzlj,mjfs
) values
(id, nameCode, packRatio, packLevel, bhxjsl,
bhzxxsbzsl, zxxsbzbhsydysl, bhxjcpbm, bzcj, thirdProductNo, addType, deviceRecordKey, isUseDy,
thirdProductName,
cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm, ylqxzcrbarmc, zczbhhzbapzbh, ylqxzcrbarywmc, uuid, sjcpbm,
versionNumber
, diType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq,
ybbm, spmc, cphhhbh, cpms, cpbsbmtxmc, isNewest, updateTime, cplx, hchzsb
, sfwblztlcp, cgzmraqxgxx, sfbjwycxsy, zdcfsycs, sfwwjbz, syqsfxyjxmj, qtxxdwzlj, mjfs) values
<foreach collection="datas" item="item" index="index"
separator=",">
(
#{item.id},
#{item.nameCode},
#{item.packRatio},
#{item.packLevel},
#{item.bhxjsl},
#{item.bhzxxsbzsl},
#{item.zxxsbzbhsydysl},
#{item.bhxjcpbm},
#{item.bzcj},
#{item.thirdProductNo},
#{item.addType},
#{item.deviceRecordKey},
#{item.isUseDy},
#{item.thirdProductName},
#{item.cpmctymc},
#{item.cplb},
#{item.flbm},
#{item.ggxh},
#{item.qxlb},
#{item.tyshxydm},
#{item.ylqxzcrbarmc},
#{item.zczbhhzbapzbh},
#{item.ylqxzcrbarywmc},
#{item.uuid},
#{item.sjcpbm},
#{item.versionNumber},
#{item.diType},
#{item.scbssfbhph},
#{item.scbssfbhxlh},
#{item.scbssfbhscrq},
#{item.scbssfbhsxrq},
#{item.ybbm},
#{item.spmc},
#{item.cphhhbh},
#{item.cpms},
#{item.cpbsbmtxmc},
#{item.isNewest},
#{item.updateTime},#{item.cplx},#{item.hchzsb},#{item.sfwblztlcp},#{item.cgzmraqxgxx},#{item.sfbjwycxsy},#{item.zdcfsycs}
,#{item.sfwwjbz},#{item.syqsfxyjxmj},#{item.qtxxdwzlj},#{item.mjfs}
)
(#{item.id},
#{item.nameCode},
#{item.packRatio},
#{item.packLevel},
#{item.bhxjsl},
#{item.bhzxxsbzsl},
#{item.zxxsbzbhsydysl},
#{item.bhxjcpbm},
#{item.bzcj},
#{item.thirdProductNo},
#{item.addType},
#{item.deviceRecordKey},
#{item.isUseDy},
#{item.thirdProductName},
#{item.cpmctymc},
#{item.cplb},
#{item.flbm},
#{item.ggxh},
#{item.qxlb},
#{item.tyshxydm},
#{item.ylqxzcrbarmc},
#{item.zczbhhzbapzbh},
#{item.ylqxzcrbarywmc},
#{item.uuid},
#{item.sjcpbm},
#{item.versionNumber},
#{item.diType},
#{item.scbssfbhph},
#{item.scbssfbhxlh},
#{item.scbssfbhscrq},
#{item.scbssfbhsxrq},
#{item.ybbm},
#{item.spmc},
#{item.cphhhbh},
#{item.cpms},
#{item.cpbsbmtxmc},
#{item.isNewest},
#{item.updateTime}, #{item.cplx}, #{item.hchzsb}, #{item.sfwblztlcp}, #{item.cgzmraqxgxx},
#{item.sfbjwycxsy}, #{item.zdcfsycs}
, #{item.sfwwjbz}, #{item.syqsfxyjxmj}, #{item.qtxxdwzlj}, #{item.mjfs})
</foreach>
</insert>
@ -534,7 +539,8 @@
</delete>
<delete id="deleteAll" parameterType="java.util.List">
DELETE FROM productinfo WHERE thirdProductNo in
DELETE
FROM productinfo WHERE thirdProductNo in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -543,44 +549,117 @@
<update id="updateProductInfo" parameterType="com.glxp.api.entity.basic.ProductInfoEntity">
UPDATE productinfo
<set>
<if test="nameCode != null">nameCode=#{nameCode},</if>
<if test="packRatio != null">packRatio=#{packRatio},</if>
<if test="packLevel != null">packLevel=#{packLevel},</if>
<if test="bhxjsl != null">bhxjsl=#{bhxjsl},</if>
<if test="bhzxxsbzsl != null">bhzxxsbzsl=#{bhzxxsbzsl},</if>
<if test="zxxsbzbhsydysl != null">zxxsbzbhsydysl=#{zxxsbzbhsydysl},</if>
<if test="bhxjcpbm != null">bhxjcpbm=#{bhxjcpbm},</if>
<if test="bzcj != null">bzcj=#{bzcj},</if>
<if test="thirdProductNo != null">thirdProductNo=#{thirdProductNo},</if>
<if test="addType != null">addType=#{addType},</if>
<if test="deviceRecordKey != null">deviceRecordKey=#{deviceRecordKey},</if>
<if test="isUseDy != null">isUseDy=#{isUseDy},</if>
<if test="thirdProductName != null">thirdProductName=#{thirdProductName},</if>
<if test="cpmctymc != null">cpmctymc=#{cpmctymc},</if>
<if test="cplb != null">cplb=#{cplb},</if>
<if test="flbm != null">flbm=#{flbm},</if>
<if test="ggxh != null">ggxh=#{ggxh},</if>
<if test="qxlb != null">qxlb=#{qxlb},</if>
<if test="tyshxydm != null">tyshxydm=#{tyshxydm},</if>
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
<if test="ylqxzcrbarywmc != null">ylqxzcrbarywmc=#{ylqxzcrbarywmc},</if>
<if test="uuid != null">uuid=#{uuid},</if>
<if test="sjcpbm != null">sjcpbm=#{sjcpbm},</if>
<if test="versionNumber != null">versionNumber=#{versionNumber},</if>
<if test="diType != null">diType=#{diType},</if>
<if test="isNewest != null">isNewest=#{isNewest},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="cplx != null">cplx=#{cplx},</if>
<if test="hchzsb != null">hchzsb=#{hchzsb},</if>
<if test="sfwblztlcp != null">sfwblztlcp=#{sfwblztlcp},</if>
<if test="cgzmraqxgxx != null">cgzmraqxgxx=#{cgzmraqxgxx},</if>
<if test="sfbjwycxsy != null">sfbjwycxsy=#{sfbjwycxsy},</if>
<if test="zdcfsycs != null">zdcfsycs=#{zdcfsycs},</if>
<if test="sfwwjbz != null">sfwwjbz=#{sfwwjbz},</if>
<if test="syqsfxyjxmj != null">syqsfxyjxmj=#{syqsfxyjxmj},
</if>
<if test="qtxxdwzlj != null">qtxxdwzlj=#{qtxxdwzlj},</if>
<if test="mjfs != null">mjfs=#{mjfs},</if>
<if test="nameCode != null">
nameCode=#{nameCode},
</if>
<if test="packRatio != null">
packRatio=#{packRatio},
</if>
<if test="packLevel != null">
packLevel=#{packLevel},
</if>
<if test="bhxjsl != null">
bhxjsl=#{bhxjsl},
</if>
<if test="bhzxxsbzsl != null">
bhzxxsbzsl=#{bhzxxsbzsl},
</if>
<if test="zxxsbzbhsydysl != null">
zxxsbzbhsydysl=#{zxxsbzbhsydysl},
</if>
<if test="bhxjcpbm != null">
bhxjcpbm=#{bhxjcpbm},
</if>
<if test="bzcj != null">
bzcj=#{bzcj},
</if>
<if test="thirdProductNo != null">
thirdProductNo=#{thirdProductNo},
</if>
<if test="addType != null">
addType=#{addType},
</if>
<if test="deviceRecordKey != null">
deviceRecordKey=#{deviceRecordKey},
</if>
<if test="isUseDy != null">
isUseDy=#{isUseDy},
</if>
<if test="thirdProductName != null">
thirdProductName=#{thirdProductName},
</if>
<if test="cpmctymc != null">
cpmctymc=#{cpmctymc},
</if>
<if test="cplb != null">
cplb=#{cplb},
</if>
<if test="flbm != null">
flbm=#{flbm},
</if>
<if test="ggxh != null">
ggxh=#{ggxh},
</if>
<if test="qxlb != null">
qxlb=#{qxlb},
</if>
<if test="tyshxydm != null">
tyshxydm=#{tyshxydm},
</if>
<if test="ylqxzcrbarmc != null">
ylqxzcrbarmc=#{ylqxzcrbarmc},
</if>
<if test="ylqxzcrbarywmc != null">
ylqxzcrbarywmc=#{ylqxzcrbarywmc},
</if>
<if test="uuid != null">
uuid=#{uuid},
</if>
<if test="sjcpbm != null">
sjcpbm=#{sjcpbm},
</if>
<if test="versionNumber != null">
versionNumber=#{versionNumber},
</if>
<if test="diType != null">
diType=#{diType},
</if>
<if test="isNewest != null">
isNewest=#{isNewest},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="cplx != null">
cplx=#{cplx},
</if>
<if test="hchzsb != null">
hchzsb=#{hchzsb},
</if>
<if test="sfwblztlcp != null">
sfwblztlcp=#{sfwblztlcp},
</if>
<if test="cgzmraqxgxx != null">
cgzmraqxgxx=#{cgzmraqxgxx},
</if>
<if test="sfbjwycxsy != null">
sfbjwycxsy=#{sfbjwycxsy},
</if>
<if test="zdcfsycs != null">
zdcfsycs=#{zdcfsycs},
</if>
<if test="sfwwjbz != null">
sfwwjbz=#{sfwwjbz},
</if>
<if test="syqsfxyjxmj != null">
syqsfxyjxmj=#{syqsfxyjxmj},
</if>
<if test="qtxxdwzlj != null">
qtxxdwzlj=#{qtxxdwzlj},
</if>
<if test="mjfs != null">
mjfs=#{mjfs},
</if>
</set>
WHERE id = #{id}
</update>
@ -588,29 +667,69 @@
<update id="updateProductByUuid" parameterType="com.glxp.api.entity.basic.ProductInfoEntity">
UPDATE productinfo
<set>
<if test="scbssfbhph != null">scbssfbhph=#{scbssfbhph},</if>
<if test="scbssfbhxlh != null">scbssfbhxlh=#{scbssfbhxlh},</if>
<if test="scbssfbhscrq != null">scbssfbhscrq=#{scbssfbhscrq},</if>
<if test="scbssfbhsxrq != null">scbssfbhsxrq=#{scbssfbhsxrq},</if>
<if test="ybbm != null">ybbm=#{ybbm},</if>
<if test="spmc != null">spmc=#{spmc},</if>
<if test="cphhhbh != null">cphhhbh=#{cphhhbh},</if>
<if test="cpms != null">cpms=#{cpms},</if>
<if test="cpbsbmtxmc != null">cpbsbmtxmc=#{cpbsbmtxmc},</if>
<if test="isNewest != null">isNewest=#{isNewest},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="cplx != null">cplx=#{cplx},</if>
<if test="hchzsb != null">hchzsb=#{hchzsb},
</if>
<if test="sfwblztlcp != null">sfwblztlcp=#{sfwblztlcp},</if>
<if test="cgzmraqxgxx != null">cgzmraqxgxx=#{cgzmraqxgxx},</if>
<if test="sfbjwycxsy != null">sfbjwycxsy=#{sfbjwycxsy},</if>
<if test="zdcfsycs != null">zdcfsycs=#{zdcfsycs},</if>
<if test="sfwwjbz != null">sfwwjbz=#{sfwwjbz},</if>
<if test="syqsfxyjxmj != null">syqsfxyjxmj=#{syqsfxyjxmj},
</if>
<if test="qtxxdwzlj != null">qtxxdwzlj=#{qtxxdwzlj},</if>
<if test="mjfs != null">mjfs=#{mjfs},</if>
<if test="scbssfbhph != null">
scbssfbhph=#{scbssfbhph},
</if>
<if test="scbssfbhxlh != null">
scbssfbhxlh=#{scbssfbhxlh},
</if>
<if test="scbssfbhscrq != null">
scbssfbhscrq=#{scbssfbhscrq},
</if>
<if test="scbssfbhsxrq != null">
scbssfbhsxrq=#{scbssfbhsxrq},
</if>
<if test="ybbm != null">
ybbm=#{ybbm},
</if>
<if test="spmc != null">
spmc=#{spmc},
</if>
<if test="cphhhbh != null">
cphhhbh=#{cphhhbh},
</if>
<if test="cpms != null">
cpms=#{cpms},
</if>
<if test="cpbsbmtxmc != null">
cpbsbmtxmc=#{cpbsbmtxmc},
</if>
<if test="isNewest != null">
isNewest=#{isNewest},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="cplx != null">
cplx=#{cplx},
</if>
<if test="hchzsb != null">
hchzsb=#{hchzsb},
</if>
<if test="sfwblztlcp != null">
sfwblztlcp=#{sfwblztlcp},
</if>
<if test="cgzmraqxgxx != null">
cgzmraqxgxx=#{cgzmraqxgxx},
</if>
<if test="sfbjwycxsy != null">
sfbjwycxsy=#{sfbjwycxsy},
</if>
<if test="zdcfsycs != null">
zdcfsycs=#{zdcfsycs},
</if>
<if test="sfwwjbz != null">
sfwwjbz=#{sfwwjbz},
</if>
<if test="syqsfxyjxmj != null">
syqsfxyjxmj=#{syqsfxyjxmj},
</if>
<if test="qtxxdwzlj != null">
qtxxdwzlj=#{qtxxdwzlj},
</if>
<if test="mjfs != null">
mjfs=#{mjfs},
</if>
</set>
WHERE uuid = #{uuid}
</update>
@ -620,7 +739,8 @@
<select id="findAllUuids" parameterType="com.glxp.api.util.page.ListPageRequest" resultType="java.lang.String">
SELECT uuid
from device
group by uuid limit #{page}, #{limit}
group by uuid
limit #{page}, #{limit}
</select>
<select id="findAllTyshxyh" resultType="java.lang.String">
SELECT tyshxydm

@ -53,6 +53,87 @@
</where>
</select>
<select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvPreinProductResponse">
select ipp.id,
ipp.nameCode,
bp.cpmctymc,
ipp.relId,
bp.ggxh,
ipp.batchNo,
ipp.produceDate,
ipp.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
ipp.inCount,
ipp.outCount,
ipp.reCount,
basic_corp.name supName,
ipp.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
as.name spaceName,
ipp.deptCode,
ipp.invCode
from inv_prein_product_detail ipp
inner join basic_udirel on ipp.relId = 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
left join auth_space `as` on ipp.code = `as`.code
<where>
<if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != null and nameCode != ''">
AND ipp.nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="relIdFk != null and relIdFk != ''">
AND ipp.relId = #{relIdFk}
</if>
<if test="ggxh != null and ggxh != ''">
AND bp.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="batchNo != null and batchNo != ''">
AND ipp.batchNo like concat('%', #{batchNo}, '%')
</if>
<if test="productionDate != null and productionDate != ''">
AND ipp.produceDate = #{productionDate}
</if>
<if test="expireDate != null and expireDate != ''">
AND ipp.expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != null and ylqxzcrbarmc != ''">
AND bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%')
</if>
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%')
</if>
<if test="supId != null and supId != ''">
AND ipp.supId = #{supId}
</if>
<if test="deptCode != null and deptCode != ''">
AND ipp.deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND ipp.invCode = #{invCode}
</if>
<if test="spaceCode != null and spaceCode != ''">
AND ipp.invSpaceCode = #{spaceCode}
</if>
<if test="invCodes != null and invCodes.size() != 0">
AND ipp.invCode in
<foreach collection="invCodes" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY ipp.relId, ipp.batchNo
order by ipp.updateTime desc
</select>
<delete id="deleteInvPreProductDetail">
delete
from inv_prein_product_detail
@ -74,49 +155,46 @@
</if>
</where>
</delete>
<select id="selectGroupDetail" resultType="com.glxp.api.entity.inv.InvPreInProductDetailEntity">
select *
from inv_prein_product_detail
<select id="getInvProductInfo" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
select ipd.code,
ipd.relId,
ipd.batchNo,
ipd.serialNo,
ipd.invSpaceCode,
ipd.invCode,
bp.cpmctymc productName,
bp.ggxh,
bp.measname,
bp.zczbhhzbapzbh,
bp.manufactory,
(select name from auth_space s where s.code = ipd.invSpaceCode) invSpaceName,
(select name from basic_corp bc where bc.erpId = ipd.supId) supName
from inv_prein_product_detail ipd
left join basic_udirel bu on bu.id = ipd.relId
left join basic_products bp on bp.uuid = bu.uuid
<where>
<if test="code != null and code != ''">
AND code = #{code}
</if>
<if test="mainAction != null and mainAction != ''">
AND mainAction = #{mainAction}
</if>
<if test="action != null and action != ''">
AND action = #{action}
</if>
<if test="supId != null and supId != ''">
and supId = #{supId}
</if>
<if test="relId != null and relId != ''">
AND relId = #{relId}
</if>
<if test="nameCode != null and nameCode != ''">
AND nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="orderId != null and orderId != ''">
AND orderId = #{orderId}
</if>
<if test="deptCode != null and deptCode != ''">
AND deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND invCode = #{invCode}
AND ipd.invCode = #{invCode}
</if>
<if test="invSpaceCode != null and invSpaceCode != ''">
AND invSpaceCode = #{invSpaceCode}
AND ipd.invSpaceCode = #{invSpaceCode}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
<if test="code != null and code != ''">
AND ipd.code = #{code}
</if>
<if test="batchNo == null and batchNo == ''">
AND batchNo is null
<if test="orderId != null and orderId != ''">
AND ipd.orderId = #{orderId}
</if>
</where>
group by
group by ipd.id
</select>
<update id="batchBindSpace">
update inv_prein_product_detail
set invSpaceCode = #{invSpaceCode}
where id in
<foreach collection="ids" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>

@ -3,32 +3,32 @@
<mapper namespace="com.glxp.api.dao.inv.InvPreProductDao">
<select id="filterList" resultType="com.glxp.api.res.inv.InvPreProductResponse">
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,
bp.measname
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,
bp.measname
from inv_pre_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 != ''">
@ -82,11 +82,11 @@
<select id="filterPreProductList" resultType="com.glxp.api.entity.inv.InvPreProductEntity">
select ipp.*
from inv_pre_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 != ''">

@ -1,6 +1,86 @@
<?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.inv.InvPreProductDetailDao">
<select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvPreinProductResponse">
select ipp.id,
ipp.nameCode,
bp.cpmctymc,
ipp.relId,
bp.ggxh,
ipp.batchNo,
ipp.produceDate,
ipp.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
ipp.inCount,
ipp.outCount,
ipp.reCount,
basic_corp.name supName,
ipp.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
as.name spaceName,
ipp.deptCode,
ipp.invCode
from inv_pre_product_detail ipp
inner join basic_udirel on ipp.relId = 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
left join auth_space `as` on ipp.code = `as`.code
<where>
<if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != null and nameCode != ''">
AND ipp.nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="relIdFk != null and relIdFk != ''">
AND ipp.relId = #{relIdFk}
</if>
<if test="ggxh != null and ggxh != ''">
AND bp.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="batchNo != null and batchNo != ''">
AND ipp.batchNo like concat('%', #{batchNo}, '%')
</if>
<if test="productionDate != null and productionDate != ''">
AND ipp.produceDate = #{productionDate}
</if>
<if test="expireDate != null and expireDate != ''">
AND ipp.expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != null and ylqxzcrbarmc != ''">
AND bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%')
</if>
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%')
</if>
<if test="supId != null and supId != ''">
AND ipp.supId = #{supId}
</if>
<if test="deptCode != null and deptCode != ''">
AND ipp.deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND ipp.invCode = #{invCode}
</if>
<if test="spaceCode != null and spaceCode != ''">
AND ipp.invSpaceCode = #{spaceCode}
</if>
<if test="invCodes != null and invCodes.size() != 0">
AND ipp.invCode in
<foreach collection="invCodes" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY ipp.relId, ipp.batchNo
order by ipp.updateTime desc
</select>
<select id="filterPreProductDetailList" resultType="com.glxp.api.entity.inv.InvPreProductDetailEntity">
select *
from inv_pre_product_detail
@ -74,4 +154,47 @@
</if>
</where>
</delete>
<select id="getInvProductInfo" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
select ipd.code,
ipd.relId,
ipd.batchNo,
ipd.serialNo,
ipd.invSpaceCode,
ipd.invCode,
bp.cpmctymc productName,
bp.ggxh,
bp.measname,
bp.zczbhhzbapzbh,
bp.manufactory,
(select name from auth_space s where s.code = ipd.invSpaceCode) invSpaceName,
(select name from basic_corp bc where bc.erpId = ipd.supId) supName
from inv_pre_product_detail ipd
left join basic_udirel bu on bu.id = ipd.relId
left join basic_products bp on bp.uuid = bu.uuid
<where>
<if test="invCode != null and invCode != ''">
AND ipd.invCode = #{invCode}
</if>
<if test="invSpaceCode != null and invSpaceCode != ''">
AND ipd.invSpaceCode = #{invSpaceCode}
</if>
<if test="code != null and code != ''">
AND ipd.code = #{code}
</if>
<if test="orderId != null and orderId != ''">
AND ipd.orderId = #{orderId}
</if>
</where>
group by ipd.id
</select>
<update id="batchBindSpace">
update inv_pre_product_detail
set invSpaceCode = #{invSpaceCode}
where id in
<foreach collection="ids" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>

@ -134,4 +134,5 @@
</if>
</where>
</select>
</mapper>

@ -6,34 +6,34 @@
<select id="filterList" resultType="com.glxp.api.res.inv.InvProductResponse"
parameterType="com.glxp.api.req.inv.FilterInvProductRequest">
select ip.id,
ip.nameCode,
bp.cpmctymc,
bp.measname,
ip.relIdFk,
bp.ggxh,
ip.batchNo,
ip.productionDate,
ip.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
sum(ip.inCount) as inCount,
sum(ip.outCount) as outCount,
sum(ip.reCount) as reCount,
ip.customerId,
basic_corp.name supName,
ip.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
ip.deptCode,
ip.invCode,
as.name spaceName
ip.nameCode,
bp.cpmctymc,
bp.measname,
ip.relIdFk,
bp.ggxh,
ip.batchNo,
ip.productionDate,
ip.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
sum(ip.inCount) as inCount,
sum(ip.outCount) as outCount,
sum(ip.reCount) as reCount,
ip.customerId,
basic_corp.name supName,
ip.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
ip.deptCode,
ip.invCode,
as.name spaceName
from inv_product ip
inner join basic_udirel on ip.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode
left join auth_warehouse on auth_warehouse.code = ip.invCode
left join auth_space `as` on ip.invSpaceCode = `as`.code
inner join basic_udirel on ip.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode
left join auth_warehouse on auth_warehouse.code = ip.invCode
left join auth_space `as` on ip.invSpaceCode = `as`.code
<where>
bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''">
@ -91,26 +91,26 @@
<select id="stockStatistics" resultType="com.glxp.api.res.inv.InvProductResponse">
select bp.cpmctymc,
bp.nameCode,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
bc.name supName,
bp.ggxh,
aw.name invName,
ip.batchNo,
ip.relIdFk,
ip.productionDate,
ip.expireDate,
ip.customerId,
ip.supId,
sum(ip.inCount) inCount,
sum(ip.outCount) outCount,
sum(ip.reCount) reCount
bp.nameCode,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
bc.name supName,
bp.ggxh,
aw.name invName,
ip.batchNo,
ip.relIdFk,
ip.productionDate,
ip.expireDate,
ip.customerId,
ip.supId,
sum(ip.inCount) inCount,
sum(ip.outCount) outCount,
sum(ip.reCount) reCount
from inv_product ip
inner join basic_udirel bu on ip.relIdFk = bu.id
inner join basic_products bp on bu.uuid = bp.uuid
left join basic_corp bc on ip.supId = bc.erpId
left join auth_warehouse aw on aw.code = ip.invCode
inner join basic_udirel bu on ip.relIdFk = bu.id
inner join basic_products bp on bu.uuid = bp.uuid
left join basic_corp bc on ip.supId = bc.erpId
left join auth_warehouse aw on aw.code = ip.invCode
<where>
bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''">
@ -150,13 +150,13 @@
<select id="getMAInvProducts" resultType="com.glxp.api.res.inv.InvProductResponse">
select ip.id, bp.nameCode, bp.cpmctymc, bp.ggxh, ip.batchNo, ip.productionDate, ip.expireDate
from inv_product ip
left join inv_product_detail ipd
on ip.relIdFk = ipd.relId and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
left join basic_udirel bu on bu.id = ip.relIdFk
left join basic_products bp on bu.uuid = bp.uuid
left join inv_product_detail ipd
on ip.relIdFk = ipd.relId and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
left join basic_udirel bu on bu.id = ip.relIdFk
left join basic_products bp on bu.uuid = bp.uuid
<where>
( ip.inCount - ip.outCount ) > 0
(ip.inCount - ip.outCount) > 0
<if test="nameCode != null and nameCode != ''">
AND bp.nameCode like concat('%', #{nameCode}, '%')
</if>
@ -182,10 +182,10 @@
<select id="selectProductInfo" resultType="com.glxp.api.entity.inv.InvProductEntity">
select ip.*
from inv_product ip
left join inv_product_detail ipd on ip.relIdFk = ipd.relId
and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
and ip.deptCode = ipd.deptCode
and ip.invCode = ipd.invCode
left join inv_product_detail ipd on ip.relIdFk = ipd.relId
and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
and ip.deptCode = ipd.deptCode
and ip.invCode = ipd.invCode
<where>
<if test="relId != null and relId != ''">
AND ip.relIdFk = #{relId}
@ -208,22 +208,22 @@
<select id="getCountInvProduct" resultType="com.glxp.api.res.inv.InvProductResponse">
select inv_product_detail.id,
inv_product.relIdFk,
inv_product.nameCode,
inv_product.batchNo,
inv_product.productionDate,
inv_product.expireDate,
basic_products.ggxh,
inv_product.inCount,
inv_product.outCount,
sum(inv_product.inCount - inv_product.outCount) reCount,
basic_products.cpmctymc
inv_product.relIdFk,
inv_product.nameCode,
inv_product.batchNo,
inv_product.productionDate,
inv_product.expireDate,
basic_products.ggxh,
inv_product.inCount,
inv_product.outCount,
sum(inv_product.inCount - inv_product.outCount) reCount,
basic_products.cpmctymc
from inv_product_detail
left join inv_product on inv_product_detail.relId = inv_product.relIdFk
and inv_product.invCode = inv_product_detail.invCode
AND IFNULL(inv_product.batchNo, 'empty') = IFNULL(inv_product_detail.batchNo, 'empty')
left join basic_udirel on inv_product_detail.relId = basic_udirel.id
left join basic_products on basic_products.uuid = basic_udirel.uuid
left join inv_product on inv_product_detail.relId = inv_product.relIdFk
and inv_product.invCode = inv_product_detail.invCode
AND IFNULL(inv_product.batchNo, 'empty') = IFNULL(inv_product_detail.batchNo, 'empty')
left join basic_udirel on inv_product_detail.relId = basic_udirel.id
left join basic_products on basic_products.uuid = basic_udirel.uuid
<where>
<if test="invCode != null and invCode != ''">
AND inv_product_detail.invCode = #{invCode}
@ -246,19 +246,19 @@
<select id="selectInvProductInfo" resultType="com.glxp.api.entity.inv.InvProductEntity">
select ip.relIdFk,
ip.deptCode,
ip.invCode,
ipd.invSpaceCode,
ip.batchNo,
ip.productionDate,
ip.expireDate,
ip.supId,
ip.inCount,
ip.outCount,
ip.reCount
ip.deptCode,
ip.invCode,
ipd.invSpaceCode,
ip.batchNo,
ip.productionDate,
ip.expireDate,
ip.supId,
ip.inCount,
ip.outCount,
ip.reCount
from inv_product ip
left join inv_product_detail ipd
on ip.relIdFk = ipd.relId and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
left join inv_product_detail ipd
on ip.relIdFk = ipd.relId and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
<where>
<if test="invCode != null and invCode != ''">
AND ip.invCode = #{invCode}
@ -276,10 +276,10 @@
<select id="filterProductNames" resultType="com.glxp.api.res.inv.InvProductResponse">
select ip.relIdFk, bp.cpmctymc, bp.ggxh
from inv_product ip
left join inv_product_detail ipd on ip.relIdFk = ipd.relId and ip.invCode = ipd.invCode and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
left join basic_udirel bu on bu.id = ip.relIdFk
left join basic_products bp on bp.uuid = bu.uuid
left join inv_product_detail ipd on ip.relIdFk = ipd.relId and ip.invCode = ipd.invCode and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
left join basic_udirel bu on bu.id = ip.relIdFk
left join basic_products bp on bp.uuid = bu.uuid
<where>
<if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
@ -297,33 +297,33 @@
<select id="filterProductList" resultType="com.glxp.api.res.inv.InvProductResponse"
parameterType="com.glxp.api.req.inv.FilterInvProductRequest">
select ip.id,
ip.nameCode,
bp.cpmctymc,
ip.relIdFk,
bp.ggxh,
ip.batchNo,
ip.productionDate,
ip.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
sum(ip.inCount) as inCount,
sum(ip.outCount) as outCount,
sum(ip.reCount) as reCount,
ip.customerId,
basic_corp.name supName,
ip.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
ip.deptCode,
ip.invCode
ip.nameCode,
bp.cpmctymc,
ip.relIdFk,
bp.ggxh,
ip.batchNo,
ip.productionDate,
ip.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
sum(ip.inCount) as inCount,
sum(ip.outCount) as outCount,
sum(ip.reCount) as reCount,
ip.customerId,
basic_corp.name supName,
ip.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
ip.deptCode,
ip.invCode
from inv_product ip
inner join basic_udirel on ip.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode
left join auth_warehouse on auth_warehouse.code = ip.invCode
left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
inner join basic_udirel on ip.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode
left join auth_warehouse on auth_warehouse.code = ip.invCode
left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
<where>
bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''">

@ -3,6 +3,86 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.inv.InvProductDetailDao">
<select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvProductResponse">
select ipp.id,
ipp.nameCode,
bp.cpmctymc,
ipp.relId,
bp.ggxh,
ipp.batchNo,
ipp.produceDate,
ipp.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
ipp.inCount,
ipp.outCount,
ipp.reCount,
basic_corp.name supName,
ipp.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
as.name spaceName,
ipp.deptCode,
ipp.invCode
from inv_product_detail ipp
inner join basic_udirel on ipp.relId = 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
left join auth_space `as` on ipp.code = `as`.code
<where>
<if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != null and nameCode != ''">
AND ipp.nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="relIdFk != null and relIdFk != ''">
AND ipp.relId = #{relIdFk}
</if>
<if test="ggxh != null and ggxh != ''">
AND bp.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="batchNo != null and batchNo != ''">
AND ipp.batchNo like concat('%', #{batchNo}, '%')
</if>
<if test="productionDate != null and productionDate != ''">
AND ipp.produceDate = #{productionDate}
</if>
<if test="expireDate != null and expireDate != ''">
AND ipp.expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != null and ylqxzcrbarmc != ''">
AND bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%')
</if>
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%')
</if>
<if test="supId != null and supId != ''">
AND ipp.supId = #{supId}
</if>
<if test="deptCode != null and deptCode != ''">
AND ipp.deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND ipp.invCode = #{invCode}
</if>
<if test="invSpaceCode != null and invSpaceCode != ''">
AND ipp.invSpaceCode = #{invSpaceCode}
</if>
<if test="invCodes != null and invCodes.size() != 0">
AND ipp.invCode in
<foreach collection="invCodes" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY ipp.relId, ipp.batchNo
order by ipp.updateTime desc
</select>
<select id="filterInvProductDetailList" resultType="com.glxp.api.entity.inv.InvProductDetailEntity"
parameterType="com.glxp.api.req.inv.FilterInvProductDetailRequest">
select *
@ -101,12 +181,12 @@
aw.name invName,
sp.name invSpaceName
from inv_product_detail pd
left join basic_udirel bu on pd.relId = bu.id
left join basic_products bp on bp.uuid = bu.uuid
left join auth_dept ad on pd.deptCode = ad.code
left join auth_warehouse aw on pd.invCode = aw.code
left join auth_space sp on pd.invSpaceCode = sp.code
and sp.invStorageCode = pd.deptCode and sp.invWarehouseCode = pd.invCode
left join basic_udirel bu on pd.relId = bu.id
left join basic_products bp on bp.uuid = bu.uuid
left join auth_dept ad on pd.deptCode = ad.code
left join auth_warehouse aw on pd.invCode = aw.code
left join auth_space sp on pd.invSpaceCode = sp.code
and sp.invStorageCode = pd.deptCode and sp.invWarehouseCode = pd.invCode
<where>
<if test="deptCode != null and deptCode != ''">
AND pd.deptCode = #{deptCode}
@ -127,7 +207,7 @@
<update id="batchBindSpace">
update inv_product_detail
set invSpaceCode = #{invSpaceCode}
where id in
where id in
<foreach collection="ids" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
@ -182,8 +262,8 @@
(select name from auth_space s where s.code = ipd.invSpaceCode) invSpaceName,
(select name from basic_corp bc where bc.erpId = ipd.supId) supName
from inv_product_detail ipd
left join basic_udirel bu on bu.id = ipd.relId
left join basic_products bp on bp.uuid = bu.uuid
left join basic_udirel bu on bu.id = ipd.relId
left join basic_products bp on bp.uuid = bu.uuid
<where>
<if test="invCode != null and invCode != ''">
AND ipd.invCode = #{invCode}
@ -210,9 +290,9 @@
o.fromType,
o.createTime,
o.auditTime,
(select employeeName from auth_user where id = o.reviewUser) reviewUserName
(select employeeName from auth_user where id = o.reviewUser) reviewUserName
from inv_product_detail ipd
left join io_order o on ipd.orderId = o.billNo
left join io_order o on ipd.orderId = o.billNo
<where>
<if test="invCode != null and invCode != ''">
AND ipd.invCode = #{invCode}

@ -34,7 +34,7 @@
parameterType="com.glxp.api.entity.sync.BasicDownloadStatusEntity">
replace
INTO basic_download_status(id, taskId, idDatas, status, type, updateTime, scheduleType, startTime,
endTime, remark,cacheFilePath)
endTime, remark, cacheFilePath)
values (#{id},
#{taskId},
#{idDatas},
@ -45,7 +45,7 @@
#{startTime},
#{endTime},
#{remark},
#{cacheFilePath})
#{cacheFilePath})
</insert>
<update id="updateDownloadStatus" parameterType="com.glxp.api.entity.sync.BasicDownloadStatusEntity">
@ -75,6 +75,9 @@
<if test="remark != null">
remark=#{remark},
</if>
<if test="cacheFilePath != null">
cacheFilePath=#{cacheFilePath},
</if>
</trim>
WHERE id = #{id}
</update>
@ -91,6 +94,8 @@
</delete>
<delete id="deleteByDate">
delete from basic_download_status where date_format(#{date}, '%Y-%m-%d') >= date_format(updateTime, '%Y-%m-%d')
delete
from basic_download_status
where date_format(#{date}, '%Y-%m-%d') >= date_format(updateTime, '%Y-%m-%d')
</delete>
</mapper>

@ -2,28 +2,29 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.sync.BasicExportDao">
<select id="filterExportStatus" parameterType="com.glxp.api.req.sync.BasicExportStatusRequest"
resultType="com.glxp.api.entity.sync.BasicExportStatusEntity">
select * from basic_export_status
select *
from basic_export_status
<where>
<if test="id != null and id != ''">
AND id LIKE concat('%',#{id},'%')
AND id LIKE concat('%', #{id}, '%')
</if>
<if test="status!=null">
<if test="status != null">
and status = #{status}
</if>
<if test="type!=null">
<if test="type != null">
and `type` = #{type}
</if>
<if test="idDatas != '' and idDatas!=null">
<if test="idDatas != '' and idDatas != null">
and idDatas = #{idDatas}
</if>
<if test="scheduleType!=null">
<if test="scheduleType != null">
and scheduleType = #{scheduleType}
</if>
<if test="syncTime != null and syncTime != ''">
and #{syncTime} >= startTime and #{syncTime} &lt;= endTime
and #{syncTime} >= startTime
and #{syncTime} &lt;= endTime
</if>
</where>
order by updateTime desc
@ -33,32 +34,50 @@
<insert id="insertExportStatus" keyProperty="id"
parameterType="com.glxp.api.entity.sync.BasicExportStatusEntity">
replace
INTO basic_export_status(id,idDatas,status,type,updateTime,scheduleType,startTime,endTime,remark,cacheFilePath)
values(
#{id},
#{idDatas},
#{status},
#{type},
#{updateTime},
#{scheduleType},
#{startTime},
#{endTime},
#{remark},
#{cacheFilePath}
)
INTO basic_export_status(id, idDatas, status, type, updateTime, scheduleType, startTime, endTime,
remark, cacheFilePath)
values (#{id},
#{idDatas},
#{status},
#{type},
#{updateTime},
#{scheduleType},
#{startTime},
#{endTime},
#{remark},
#{cacheFilePath})
</insert>
<update id="updateExportStatus" parameterType="com.glxp.api.entity.sync.BasicExportStatusEntity">
UPDATE basic_export_status
<trim prefix="set" suffixOverrides=",">
<if test="idDatas != null">idDatas=#{idDatas},</if>
<if test="status != null">status=#{status},</if>
<if test="type != null">type=#{type},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="scheduleType != null">scheduleType=#{scheduleType},</if>
<if test="startTime != null">startTime=#{startTime},</if>
<if test="endTime != null">endTime=#{endTime},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="idDatas != null">
idDatas=#{idDatas},
</if>
<if test="status != null">
status=#{status},
</if>
<if test="type != null">
type=#{type},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="scheduleType != null">
scheduleType=#{scheduleType},
</if>
<if test="startTime != null">
startTime=#{startTime},
</if>
<if test="endTime != null">
endTime=#{endTime},
</if>
<if test="remark != null">
remark=#{remark},
</if>
<if test="cacheFilePath != null">
cacheFilePath=#{cacheFilePath},
</if>
</trim>
WHERE id = #{id}
</update>
@ -69,11 +88,14 @@
</delete>
<delete id="deleteByTime">
Delete From basic_export_status
where date(startTime) &lt;= date(DATE_SUB(NOW(),INTERVAL 30 day))
Delete
From basic_export_status
where date(startTime) &lt;= date(DATE_SUB(NOW(), INTERVAL 30 day))
</delete>
<delete id="deleteByDate">
delete from basic_export_status where date_format(#{date}, '%Y-%m-%d') >= date_format(startTime, '%Y-%m-%d')
delete
from basic_export_status
where date_format(#{date}, '%Y-%m-%d') >= date_format(startTime, '%Y-%m-%d')
</delete>
</mapper>

Loading…
Cancel
Save