第三方出库明细

dev_fifo1.0
anthonywj 1 year ago
parent 1551cd46e2
commit 778258acec

@ -231,7 +231,7 @@ public class BasicBussinessTypeController extends BaseController {
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@GetMapping("/udiwms/orderDetail/busTypesOptimize") @GetMapping("/udiwms/orderDetail/busTypesOptimize")
public BaseResponse orderDetailBusTypesOptimize(FilterBussinessTypeRequest bussinessTypeRequest, public BaseResponse orderDetailBusTypesOptimize(FilterBussinessTypeRequest bussinessTypeRequest,
BindingResult bindingResult) { BindingResult bindingResult) {
String detailType = bussinessTypeRequest.getDetailType(); String detailType = bussinessTypeRequest.getDetailType();
List<BasicBussinessTypeResponse> bussinessTypeResponses = new ArrayList<>(); List<BasicBussinessTypeResponse> bussinessTypeResponses = new ArrayList<>();
@ -244,8 +244,8 @@ public class BasicBussinessTypeController extends BaseController {
bussinessTypeRequest.setCode(invWarehouseEntity.getCode()); bussinessTypeRequest.setCode(invWarehouseEntity.getCode());
} }
bussinessTypeResponses = basicBussinessTypeService.filterJoinByInv(bussinessTypeRequest); bussinessTypeResponses = basicBussinessTypeService.filterJoinByInv(bussinessTypeRequest);
List<DictDto> reList = bussinessTypeResponses.stream().map(s-> { List<DictDto> reList = bussinessTypeResponses.stream().map(s -> {
DictDto dictDto = new DictDto(s.getAction(),s.getName()); DictDto dictDto = new DictDto(s.getAction(), s.getName());
return dictDto; return dictDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -315,8 +315,8 @@ public class BasicBussinessTypeController extends BaseController {
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@GetMapping("/udiwms/localBusType/filterJoinByUserOptimize") @GetMapping("/udiwms/localBusType/filterJoinByUserOptimize")
public BaseResponse filterJoinByUserOptimize(FilterBussinessTypeRequest bussinessTypeFilterRequest, public BaseResponse filterJoinByUserOptimize(FilterBussinessTypeRequest bussinessTypeFilterRequest,
BindingResult bindingResult) { BindingResult bindingResult) {
List<DictDto> reList = new ArrayList<>(); List<DictDto> reList = new ArrayList<>();
if (StrUtil.isNotEmpty(bussinessTypeFilterRequest.getVueType())) { if (StrUtil.isNotEmpty(bussinessTypeFilterRequest.getVueType())) {
List<BasicBussinessTypeEntity> result = new ArrayList<>(); List<BasicBussinessTypeEntity> result = new ArrayList<>();
List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeService.findByVueType(bussinessTypeFilterRequest.getVueType()); List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeService.findByVueType(bussinessTypeFilterRequest.getVueType());
@ -341,8 +341,8 @@ public class BasicBussinessTypeController extends BaseController {
result.addAll(bussinessTypeEntities); result.addAll(bussinessTypeEntities);
} }
reList = result.stream().map(s-> { reList = result.stream().map(s -> {
DictDto dictDto = new DictDto(s.getAction(),s.getName()); DictDto dictDto = new DictDto(s.getAction(), s.getName());
return dictDto; return dictDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} else { } else {
@ -353,8 +353,8 @@ public class BasicBussinessTypeController extends BaseController {
bussinessTypeEntities = basicBussinessTypeService.filterJoinByUser( bussinessTypeEntities = basicBussinessTypeService.filterJoinByUser(
bussinessTypeFilterRequest); bussinessTypeFilterRequest);
reList = bussinessTypeEntities.stream().map(s-> { reList = bussinessTypeEntities.stream().map(s -> {
DictDto dictDto = new DictDto(s.getAction(),s.getName()); DictDto dictDto = new DictDto(s.getAction(), s.getName());
return dictDto; return dictDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());

@ -92,7 +92,7 @@ public class BasicCorpController extends BaseController {
@GetMapping("/udiwms/basic/unit/maintain/filterOptimize") @GetMapping("/udiwms/basic/unit/maintain/filterOptimize")
public BaseResponse filterBasicUnitMaintainOptimize(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest, public BaseResponse filterBasicUnitMaintainOptimize(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest,
BindingResult bindingResult) { BindingResult bindingResult) {
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
@ -101,8 +101,8 @@ public class BasicCorpController extends BaseController {
basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest); basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
PageInfo<BasicCorpEntity> pageInfo = new PageInfo<>(basicUnitMaintainEntities); PageInfo<BasicCorpEntity> pageInfo = new PageInfo<>(basicUnitMaintainEntities);
PageSimpleResponse<DictDto> pageSimpleResponse = new PageSimpleResponse<>(); PageSimpleResponse<DictDto> pageSimpleResponse = new PageSimpleResponse<>();
List<DictDto> reList = basicUnitMaintainEntities.stream().map(s-> { List<DictDto> reList = basicUnitMaintainEntities.stream().map(s -> {
DictDto dictDto = new DictDto(s.getErpId(),s.getName()); DictDto dictDto = new DictDto(s.getErpId(), s.getName());
return dictDto; return dictDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -575,8 +575,8 @@ public class BasicCorpController extends BaseController {
public BaseResponse selectCorpListOptimize(@RequestBody BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest) { public BaseResponse selectCorpListOptimize(@RequestBody BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest) {
List<BasicCorpEntity> getCorpList = basicUnitMaintainService.selectCorpList(basicUnitMaintainFilterRequest); List<BasicCorpEntity> getCorpList = basicUnitMaintainService.selectCorpList(basicUnitMaintainFilterRequest);
List<DictDto> reList = getCorpList.stream().map(s-> { List<DictDto> reList = getCorpList.stream().map(s -> {
DictDto dictDto = new DictDto(s.getErpId(),s.getName()); DictDto dictDto = new DictDto(s.getErpId(), s.getName());
return dictDto; return dictDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return ResultVOUtils.success(reList); return ResultVOUtils.success(reList);

@ -162,8 +162,7 @@ public class ThrInvOrderController {
*/ */
@PostMapping("/udiwms/thrsys/downloadInvOrder") @PostMapping("/udiwms/thrsys/downloadInvOrder")
public BaseResponse downloadInvOrder(@RequestBody @Valid FilterDownloadInvOrderRequest filterDownloadInvOrderRequest) { public BaseResponse downloadInvOrder(@RequestBody @Valid FilterDownloadInvOrderRequest filterDownloadInvOrderRequest) {
thrInvOrderService.downloadInvSfOrderFilter(filterDownloadInvOrderRequest); return thrInvOrderService.downloadInvSfOrderFilter(filterDownloadInvOrderRequest);
return ResultVOUtils.success();
} }
/** /**

@ -118,6 +118,8 @@ public class ThrInvOrder implements Serializable {
*/ */
private Integer skProject; private Integer skProject;
private String fromCorp;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

@ -1,205 +0,0 @@
package com.glxp.api.entity.thrsys;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
@ApiModel(value="com-glxp-api-entity-thrsys-ThrInvOrderDetail")
@Data
@TableName(value = "thr_inv_order_detail")
public class ThrInvOrderDetailEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
@ApiModelProperty(value="")
private Integer id;
/**
*
*/
@TableField(value = "orderIdFk")
@ApiModelProperty(value="单据号")
private String orderIdFk;
/**
*
*/
@TableField(value = "cpmctymc")
@ApiModelProperty(value="产品通用名称")
private String cpmctymc;
/**
*
*/
@TableField(value = "relId")
@ApiModelProperty(value="物资字典主键")
private Integer relId;
/**
* /
*/
@TableField(value = "thrCode")
@ApiModelProperty(value="第三方项目编码/耗材字典")
private String thrCode;
/**
* DI
*/
@TableField(value = "nameCode")
@ApiModelProperty(value="DI")
private String nameCode;
/**
*
*/
@TableField(value = "ggxh")
@ApiModelProperty(value="规格型号")
private String ggxh;
/**
*
*/
@TableField(value = "batchNo")
@ApiModelProperty(value="批次号")
private Integer batchNo;
/**
*
*/
@TableField(value = "measname")
@ApiModelProperty(value="计量单位")
private String measname;
/**
*
*/
@TableField(value = "price")
@ApiModelProperty(value="价格")
private BigDecimal price;
/**
*
*/
@TableField(value = "productionDate")
@ApiModelProperty(value="生产日期")
private Date productionDate;
/**
*
*/
@TableField(value = "expireDate")
@ApiModelProperty(value="失效日期")
private Date expireDate;
/**
*
*/
@TableField(value = "ylqxzcrbarmc")
@ApiModelProperty(value="医疗器械注册备案人")
private String ylqxzcrbarmc;
/**
* /
*/
@TableField(value = "zczbhhzbapzbh")
@ApiModelProperty(value="注册/备案号")
private String zczbhhzbapzbh;
/**
*
*/
@TableField(value = "inCount")
@ApiModelProperty(value="入库数量")
private String inCount;
/**
*
*/
@TableField(value = "outCount")
@ApiModelProperty(value="出库数量")
private String outCount;
/**
*
*/
@TableField(value = "supName")
@ApiModelProperty(value="供应商")
private String supName;
/**
*
*/
@TableField(value = "deptName")
@ApiModelProperty(value="部门")
private String deptName;
/**
*
*/
@TableField(value = "deptCode")
@ApiModelProperty(value="部门编码")
private String deptCode;
/**
*
*/
@TableField(value = "invName")
@ApiModelProperty(value="仓库")
private String invName;
/**
*
*/
@TableField(value = "invCode")
@ApiModelProperty(value="仓库编码")
private String invCode;
/**
*
*/
@TableField(value = "spaceCode")
@ApiModelProperty(value="货位")
private String spaceCode;
/**
*
*/
@TableField(value = "spaceName")
@ApiModelProperty(value="货位编码")
private String spaceName;
/**
*
*/
@TableField(value = "reCount")
@ApiModelProperty(value="实际数量")
private String reCount;
/**
*
*/
@TableField(value = "mainAction")
@ApiModelProperty(value="出入库类型")
private String mainAction;
/**
*
*/
@TableField(value = "manufacturer")
@ApiModelProperty(value="生产企业")
private String manufacturer;
/**
*
*/
@TableField(value = "remark")
@ApiModelProperty(value="备注")
private String remark;
private static final long serialVersionUID = 1L;
}

@ -1,132 +0,0 @@
package com.glxp.api.entity.thrsys;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*/
@ApiModel(value = "com-glxp-api-entity-thrsys-ThrInvOrder")
@Data
@TableName(value = "thr_inv_order")
public class ThrInvOrderEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
@ApiModelProperty(value = "")
private Integer id;
/**
*
*/
@TableField(value = "billNo")
@ApiModelProperty(value = "单据号")
private String billNo;
/**
*
*/
@TableField(value = "billDate")
@ApiModelProperty(value = "单据时间")
private Date billDate;
/**
*
*/
@TableField(value = "startDate")
@ApiModelProperty(value = "库存开始时间")
private Date startDate;
/**
*
*/
@TableField(value = "endDate")
@ApiModelProperty(value = "库存结束时间")
private Date endDate;
/**
*
*/
@TableField(value = "mainAction")
@ApiModelProperty(value = "出入库类型")
private String mainAction;
/**
*
*/
@TableField(value = "billType")
@ApiModelProperty(value = "第三方单据类型")
private String billType;
/**
*
*/
@TableField(value = "deptCode")
@ApiModelProperty(value = "部门编码")
private String deptCode;
/**
*
*/
@TableField(value = "invCode")
@ApiModelProperty(value = "仓库编码")
private String invCode;
/**
*
*/
@TableField(value = "spaceCode")
@ApiModelProperty(value = "货位编码")
private String spaceCode;
/**
*
*/
@TableField(value = "`status`")
@ApiModelProperty(value = "单据状态")
private Byte status;
/**
*
*/
@TableField(value = "createTime")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@TableField(value = "`createUser`")
@ApiModelProperty(value = "创建人")
private String createUser;
/**
*
*/
@TableField(value = "updateTime")
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
*
*/
@TableField(value = "updateUser")
@ApiModelProperty(value = "更新人")
private String updateUser;
/**
*
*/
@TableField(value = "remark")
@ApiModelProperty(value = "备注")
private String remark;
private static final long serialVersionUID = 1L;
}

@ -39,6 +39,10 @@ public class ThrSystemBusApiEntity {
@TableField(value = "remark") @TableField(value = "remark")
private String remark; private String remark;
@TableField(value = "fromCorp")
private String fromCorp;
/** /**
* *
*/ */

@ -0,0 +1,114 @@
package com.glxp.api.res.thrsys;
import lombok.Data;
import java.util.Date;
@Data
public class ThrInvOrderResponse {
private String billTypeName;
private String invName;
private Long id;
/**
*
*/
private String billNo;
/**
*
*/
private Date billDate;
/**
*
*/
private Date startDate;
/**
*
*/
private Date endDate;
/**
*
*/
private String mainAction;
/**
*
*/
private String billType;
/**
*
*/
private String thirdSysFk;
/**
*
*/
private String deptCode;
/**
*
*/
private String invCode;
/**
*
*/
private String spaceCode;
/**
*
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private String createUser;
/**
*
*/
private Date updateTime;
/**
*
*/
private String updateUser;
/**
*
*/
private String remark;
/**
* 123
*/
private Integer sourceType;
/**
*
*/
private String exMsg;
/**
*
*/
private Integer skProject;
/**
*
*/
private String fromCorp;
}

@ -53,6 +53,7 @@ public class BasicDestinyRelService extends ServiceImpl<BasicDestinyRelMapper, B
basicSkProjectDetailEntity.setRelId(Long.parseLong(str.getUdiRlIdFk())); basicSkProjectDetailEntity.setRelId(Long.parseLong(str.getUdiRlIdFk()));
basicSkProjectDetailEntity.setSupId(Long.parseLong(str.getUnitFk())); basicSkProjectDetailEntity.setSupId(Long.parseLong(str.getUnitFk()));
basicSkProjectDetailEntity.setPId(basicDestinyRelRequest.getpId()); basicSkProjectDetailEntity.setPId(basicDestinyRelRequest.getpId());
basicSkProjectDetailEntity.setCount(1);
basicDestinyRelEntitList.add(basicSkProjectDetailEntity); basicDestinyRelEntitList.add(basicSkProjectDetailEntity);
} }
Boolean flag = basicDestinyRelMapper.insertBatch(basicDestinyRelEntitList); Boolean flag = basicDestinyRelMapper.insertBatch(basicDestinyRelEntitList);

@ -1,5 +1,6 @@
package com.glxp.api.service.thrsys; package com.glxp.api.service.thrsys;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.thrsys.ThrInvOrder; import com.glxp.api.entity.thrsys.ThrInvOrder;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity; import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
import com.glxp.api.req.inv.FilterInvProductRequest; import com.glxp.api.req.inv.FilterInvProductRequest;
@ -15,7 +16,7 @@ public interface ThrInvOrderService {
/** /**
* *
*/ */
public void handleExternalThrInvSfOrder(FilterInvProductRequest filterInvProductRequest); BaseResponse handleExternalThrInvSfOrder(FilterInvProductRequest filterInvProductRequest);
/** /**
* *
@ -35,6 +36,7 @@ public interface ThrInvOrderService {
/** /**
* *
*
* @param filterThrInvOrderRequest * @param filterThrInvOrderRequest
* @return * @return
*/ */
@ -44,6 +46,7 @@ public interface ThrInvOrderService {
/** /**
* *
*
* @param generateOrderRequest * @param generateOrderRequest
* @return * @return
*/ */
@ -53,6 +56,7 @@ public interface ThrInvOrderService {
/** /**
* *
*
* @param refreshOrderRequest * @param refreshOrderRequest
* @return * @return
*/ */
@ -60,12 +64,13 @@ public interface ThrInvOrderService {
/** /**
* *
*
* @param refreshOrderRequest * @param refreshOrderRequest
* @return * @return
*/ */
boolean refreshGhOrder(RefreshOrderRequest refreshOrderRequest); boolean refreshGhOrder(RefreshOrderRequest refreshOrderRequest);
void downloadInvSfOrderFilter(FilterDownloadInvOrderRequest filterDownloadInvOrderRequest); BaseResponse downloadInvSfOrderFilter(FilterDownloadInvOrderRequest filterDownloadInvOrderRequest);
void downloadInvGhOrderFilter(FilterDownloadInvOrderRequest filterDownloadInvOrderRequest); void downloadInvGhOrderFilter(FilterDownloadInvOrderRequest filterDownloadInvOrderRequest);

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant; import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.ConstantType; import com.glxp.api.constant.ConstantType;
@ -21,10 +22,7 @@ import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity; import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.entity.thrsys.ThrInvOrder; import com.glxp.api.entity.thrsys.*;
import com.glxp.api.entity.thrsys.ThrInvOrderDetail;
import com.glxp.api.entity.thrsys.ThrOrderEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
import com.glxp.api.http.ErpInvClient; import com.glxp.api.http.ErpInvClient;
import com.glxp.api.req.inv.FilterInvProductRequest; import com.glxp.api.req.inv.FilterInvProductRequest;
import com.glxp.api.req.thrsys.FilterDownloadInvOrderRequest; import com.glxp.api.req.thrsys.FilterDownloadInvOrderRequest;
@ -45,6 +43,7 @@ import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.service.thrsys.ThrInvOrderService; import com.glxp.api.service.thrsys.ThrInvOrderService;
import com.glxp.api.service.thrsys.ThrSystemBusApiService;
import com.glxp.api.util.GennerOrderUtils; import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.IntUtil; import com.glxp.api.util.IntUtil;
import com.glxp.api.util.OrderNoTypeBean; import com.glxp.api.util.OrderNoTypeBean;
@ -105,28 +104,40 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
@Override @Override
public void handleExternalThrInvSfOrder(FilterInvProductRequest filterInvProductRequest) { public BaseResponse handleExternalThrInvSfOrder(FilterInvProductRequest filterInvProductRequest) {
BaseResponse<PageSimpleResponse<ThrInvResultResponse>> baseResponse = erpInvClient.getInvSfResult(filterInvProductRequest); BaseResponse<PageSimpleResponse<ThrInvResultResponse>> baseResponse = erpInvClient.getInvSfResult(filterInvProductRequest);
if (baseResponse.getCode() == 20000) { if (baseResponse.getCode() == 20000) {
List<ThrInvResultResponse> list = baseResponse.getData().getList(); List<ThrInvResultResponse> list = baseResponse.getData().getList();
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
String billNo = generateBillNo(filterInvProductRequest);//单据号
//处理 返回实体 转换成 单据 和 单据明细
ThrInvOrder thrInvOrder = new ThrInvOrder();
List<ThrInvOrderDetail> thrInvOrderDetails = new ArrayList<>();
String thirdSys = filterInvProductRequest.getThirdSys();
handleExternalConvertThrInvOrderDetail(list, thrInvOrderDetails, billNo, thirdSys, thrInvOrder);
if (CollectionUtil.isNotEmpty(thrInvOrderDetails)) { Map<String, List<ThrInvResultResponse>> groupedByInv = list.stream()
.collect(Collectors.groupingBy(ThrInvResultResponse::getInvCode));
groupedByInv.forEach((invCode, invResultResponses) -> {
String billNo = generateBillNo(filterInvProductRequest);//单据号
//处理 返回实体 转换成 单据 和 单据明细
ThrInvOrder thrInvOrder = new ThrInvOrder();
List<ThrInvOrderDetail> thrInvOrderDetails = new ArrayList<>();
String thirdSys = filterInvProductRequest.getThirdSys();
handleExternalConvertThrInvOrderDetail(invResultResponses, thrInvOrderDetails, billNo, thirdSys, thrInvOrder, 1);
if (CollectionUtil.isNotEmpty(thrInvOrderDetails)) {
handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, invResultResponses.get(0), Constant.THR_INV_SF_ORDER_TYPE);
//保存数据
thrInvOrderMapper.insert(thrInvOrder);
thrInvOrderDetailMapper.insertBatch(thrInvOrderDetails);
}
});
handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, list.get(0), Constant.THR_INV_SF_ORDER_TYPE);
//保存数据
thrInvOrderMapper.insert(thrInvOrder);
thrInvOrderDetailMapper.insertBatch(thrInvOrderDetails);
}
} }
return ResultVOUtils.success("下载成功!");
} else {
return baseResponse;
} }
} }
@Override @Override
@ -140,7 +151,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
ThrInvOrder thrInvOrder = new ThrInvOrder(); ThrInvOrder thrInvOrder = new ThrInvOrder();
List<ThrInvOrderDetail> thrInvOrderDetails = new ArrayList<>(); List<ThrInvOrderDetail> thrInvOrderDetails = new ArrayList<>();
String thirdSys = filterInvProductRequest.getThirdSys(); String thirdSys = filterInvProductRequest.getThirdSys();
handleExternalConvertThrInvOrderDetail(list, thrInvOrderDetails, billNo, thirdSys, thrInvOrder); handleExternalConvertThrInvOrderDetail(list, thrInvOrderDetails, billNo, thirdSys, thrInvOrder, 0);
if (CollectionUtil.isNotEmpty(thrInvOrderDetails)) { if (CollectionUtil.isNotEmpty(thrInvOrderDetails)) {
handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, list.get(0), Constant.THR_INV_PH_ORDER_TYPE); handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, list.get(0), Constant.THR_INV_PH_ORDER_TYPE);
@ -670,14 +681,15 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
} }
@Override @Override
public void downloadInvSfOrderFilter(FilterDownloadInvOrderRequest filterDownloadInvOrderRequest) { public BaseResponse downloadInvSfOrderFilter(FilterDownloadInvOrderRequest filterDownloadInvOrderRequest) {
log.info("手动抓取第三方收费出入库明细生成单据定时任务开始"); log.info("手动抓取第三方收费出入库明细生成单据定时任务开始");
FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest(); FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
filterInvProductRequest.setThirdSys(filterDownloadInvOrderRequest.getThirdSysFk()); filterInvProductRequest.setThirdSys(filterDownloadInvOrderRequest.getThirdSysFk());
filterInvProductRequest.setStartDate(stringToDate(filterDownloadInvOrderRequest.getStartDate() + " 00:00:00")); filterInvProductRequest.setStartDate(stringToDate(filterDownloadInvOrderRequest.getStartDate() + " 00:00:00"));
filterInvProductRequest.setEndDate(stringToDate(filterDownloadInvOrderRequest.getEndDate() + " 23:59:59")); filterInvProductRequest.setEndDate(stringToDate(filterDownloadInvOrderRequest.getEndDate() + " 23:59:59"));
handleExternalThrInvSfOrder(filterInvProductRequest);
log.info("手动抓取第三方收费出入库明细生成单据定时任务结束"); log.info("手动抓取第三方收费出入库明细生成单据定时任务结束");
return handleExternalThrInvSfOrder(filterInvProductRequest);
} }
@Override @Override
@ -820,16 +832,22 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
* @param thrInvOrder * @param thrInvOrder
* @param thrInvResultResponse * @param thrInvResultResponse
*/ */
@Resource
ThrSystemBusApiService thrSystemBusApiService;
private void handleExternalConvertThrInvOrder(String billNo, FilterInvProductRequest private void handleExternalConvertThrInvOrder(String billNo, FilterInvProductRequest
filterInvProductRequest, ThrInvOrder thrInvOrder, ThrInvResultResponse thrInvResultResponse, Integer SourceType) { filterInvProductRequest, ThrInvOrder thrInvOrder, ThrInvResultResponse thrInvResultResponse, Integer SourceType) {
Date newDate = new Date(); Date newDate = new Date();
ThrSystemBusApiEntity thrSystemBusApiEntity = thrSystemBusApiService.getOne(new QueryWrapper<ThrSystemBusApiEntity>().eq("code", thrInvResultResponse.getBillType()).last("limit 1"));
thrInvOrder.setBillNo(billNo);//单据号 thrInvOrder.setBillNo(billNo);//单据号
thrInvOrder.setBillDate(newDate);//单据时间 thrInvOrder.setBillDate(newDate);//单据时间
thrInvOrder.setStartDate(filterInvProductRequest.getStartDate());//库存开始时间 thrInvOrder.setStartDate(filterInvProductRequest.getStartDate());//库存开始时间
thrInvOrder.setEndDate(filterInvProductRequest.getEndDate());//库存结束时间 thrInvOrder.setEndDate(filterInvProductRequest.getEndDate());//库存结束时间
thrInvOrder.setMainAction(thrInvResultResponse.getMainAction());//出入库类型 thrInvOrder.setMainAction(thrInvResultResponse.getMainAction());//出入库类型
thrInvOrder.setBillType(thrInvResultResponse.getMainAction());//第三方单据类型 thrInvOrder.setBillType(thrInvResultResponse.getBillType());//第三方单据类型
thrInvOrder.setThirdSysFk(filterInvProductRequest.getThirdSys());//外部系统 thrInvOrder.setThirdSysFk(filterInvProductRequest.getThirdSys());//外部系统
thrInvOrder.setDeptCode(thrInvResultResponse.getDeptCode());//部门编号 thrInvOrder.setDeptCode(thrInvResultResponse.getDeptCode());//部门编号
thrInvOrder.setInvCode(thrInvResultResponse.getInvCode());//仓库代码 thrInvOrder.setInvCode(thrInvResultResponse.getInvCode());//仓库代码
@ -837,6 +855,8 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
thrInvOrder.setStatus(ConstantStatus.SFIO_DRAFT);//单据状态 草稿 thrInvOrder.setStatus(ConstantStatus.SFIO_DRAFT);//单据状态 草稿
thrInvOrder.setSourceType(SourceType);//来源类型 thrInvOrder.setSourceType(SourceType);//来源类型
thrInvOrder.setCreateTime(newDate); thrInvOrder.setCreateTime(newDate);
if (thrSystemBusApiEntity != null)
thrInvOrder.setFromCorp(thrSystemBusApiEntity.getFromCorp());
thrInvOrder.setCreateUser("外部系统下载"); thrInvOrder.setCreateUser("外部系统下载");
} }
@ -850,9 +870,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
*/ */
private void handleExternalConvertThrInvOrderDetail private void handleExternalConvertThrInvOrderDetail
(List<ThrInvResultResponse> list, List<ThrInvOrderDetail> thrInvOrderDetails, String billNo, String (List<ThrInvResultResponse> list, List<ThrInvOrderDetail> thrInvOrderDetails, String billNo, String
thirdSys, ThrInvOrder thrInvOrder) { thirdSys, ThrInvOrder thrInvOrder, Integer sourceType) {
Integer inv_set_enable = Integer.valueOf(systemParamConfigService.selectValueByParamKey("inv_set_enable")); // Integer inv_set_enable = Integer.valueOf(systemParamConfigService.selectValueByParamKey("inv_set_enable"));
if (inv_set_enable == null || inv_set_enable == 0) {//直接明细 不走项目组套 if (sourceType == 0) {//直接明细 不走项目组套
thrInvOrder.setSkProject(0); thrInvOrder.setSkProject(0);
List<String> thrCodes = list.stream().map(ThrInvResultResponse::getThrCode).collect(Collectors.toList()); List<String> thrCodes = list.stream().map(ThrInvResultResponse::getThrCode).collect(Collectors.toList());
MainIdRelIdAndProductResponse map = udiRelevanceService.selectMainIdRelIdAndProductMap(thrCodes, thirdSys); MainIdRelIdAndProductResponse map = udiRelevanceService.selectMainIdRelIdAndProductMap(thrCodes, thirdSys);
@ -865,9 +885,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
Long relId = mainIdRelIdMap.get(thrCode); Long relId = mainIdRelIdMap.get(thrCode);
Integer count; Integer count;
if (ConstantType.TYPE_PUT.equals(mainAction)) { if (ConstantType.TYPE_PUT.equals(mainAction)) {
count = Integer.valueOf(item.getInCount()); count = IntUtil.value(item.getInCount());
} else { } else {
count = Integer.valueOf(item.getOutCount()); count = IntUtil.value(item.getOutCount());
} }
ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail(); ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail();
BeanUtils.copyProperties(item, thrInvOrderDetail); BeanUtils.copyProperties(item, thrInvOrderDetail);

@ -4,7 +4,7 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_ct?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: 123456 password: 123456
hikari: hikari:

@ -148,7 +148,7 @@
</select> </select>
<select id="selectForThirdSys" resultType="com.glxp.api.entity.basic.BasicBussinessTypeEntity"> <select id="selectForThirdSys" resultType="com.glxp.api.entity.basic.BasicBussinessTypeEntity">
select action, name select *
from basic_bussiness_type from basic_bussiness_type
where action not in (select code where action not in (select code
from thr_system_bus_api) from thr_system_bus_api)

@ -1,302 +1,290 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.thrsys.ThrInvOrderMapper"> <mapper namespace="com.glxp.api.dao.thrsys.ThrInvOrderMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrInvOrder"> <resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrInvOrder">
<!--@mbg.generated--> <!--@mbg.generated-->
<!--@Table thr_inv_order--> <!--@Table thr_inv_order-->
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="billNo" jdbcType="VARCHAR" property="billNo" /> <result column="billNo" jdbcType="VARCHAR" property="billNo"/>
<result column="billDate" jdbcType="TIMESTAMP" property="billDate" /> <result column="billDate" jdbcType="TIMESTAMP" property="billDate"/>
<result column="startDate" jdbcType="TIMESTAMP" property="startDate" /> <result column="startDate" jdbcType="TIMESTAMP" property="startDate"/>
<result column="endDate" jdbcType="TIMESTAMP" property="endDate" /> <result column="endDate" jdbcType="TIMESTAMP" property="endDate"/>
<result column="mainAction" jdbcType="VARCHAR" property="mainAction" /> <result column="mainAction" jdbcType="VARCHAR" property="mainAction"/>
<result column="billType" jdbcType="VARCHAR" property="billType" /> <result column="billType" jdbcType="VARCHAR" property="billType"/>
<result column="thirdSysFk" jdbcType="VARCHAR" property="thirdSysFk" /> <result column="thirdSysFk" jdbcType="VARCHAR" property="thirdSysFk"/>
<result column="deptCode" jdbcType="VARCHAR" property="deptCode" /> <result column="deptCode" jdbcType="VARCHAR" property="deptCode"/>
<result column="invCode" jdbcType="VARCHAR" property="invCode" /> <result column="invCode" jdbcType="VARCHAR" property="invCode"/>
<result column="spaceCode" jdbcType="VARCHAR" property="spaceCode" /> <result column="spaceCode" jdbcType="VARCHAR" property="spaceCode"/>
<result column="status" jdbcType="TINYINT" property="status" /> <result column="status" jdbcType="TINYINT" property="status"/>
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" /> <result column="createTime" jdbcType="TIMESTAMP" property="createTime"/>
<result column="createUser" jdbcType="VARCHAR" property="createUser" /> <result column="createUser" jdbcType="VARCHAR" property="createUser"/>
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" /> <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" /> <result column="updateUser" jdbcType="VARCHAR" property="updateUser"/>
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="sourceType" jdbcType="INTEGER" property="sourceType" /> <result column="sourceType" jdbcType="INTEGER" property="sourceType"/>
<result column="exMsg" jdbcType="VARCHAR" property="exMsg" /> <result column="exMsg" jdbcType="VARCHAR" property="exMsg"/>
<result column="skProject" jdbcType="INTEGER" property="skProject" /> <result column="skProject" jdbcType="INTEGER" property="skProject"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, billNo, billDate, startDate, endDate, mainAction, billType,thirdSysFk, deptCode, invCode, id, billNo, billDate, startDate, endDate, mainAction, billType,thirdSysFk, deptCode, invCode,
spaceCode, `status`, createTime, `createUser`, updateTime, updateUser, remark,sourceType,exMsg,skProject spaceCode, `status`, createTime, `createUser`, updateTime, updateUser, remark,sourceType,exMsg,skProject
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from thr_inv_order from thr_inv_order
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from thr_inv_order delete
where id = #{id,jdbcType=INTEGER} from thr_inv_order
</delete> where id = #{id,jdbcType=INTEGER}
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder" useGeneratedKeys="true"> </delete>
<!--@mbg.generated--> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder"
insert into thr_inv_order (billNo, billDate, startDate, useGeneratedKeys="true">
endDate, mainAction, billType,thirdSysFk, <!--@mbg.generated-->
deptCode, invCode, spaceCode, insert into thr_inv_order
`status`, createTime, `createUser`, <trim prefix="(" suffix=")" suffixOverrides=",">
updateTime, updateUser, remark,sourceType,exMsg,skProject <if test="billNo != null">
) billNo,
values (#{billNo,jdbcType=VARCHAR}, #{billDate,jdbcType=TIMESTAMP}, #{startDate,jdbcType=TIMESTAMP}, </if>
#{endDate,jdbcType=TIMESTAMP}, #{mainAction,jdbcType=VARCHAR}, #{billType,jdbcType=VARCHAR},#{thirdSysFk,jdbcType=VARCHAR}, <if test="billDate != null">
#{deptCode,jdbcType=VARCHAR}, #{invCode,jdbcType=VARCHAR}, #{spaceCode,jdbcType=VARCHAR}, billDate,
#{status,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=VARCHAR}, </if>
#{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{sourceType,jdbcType=INTEGER} <if test="startDate != null">
, #{exMsg,jdbcType=VARCHAR}, #{skProject,jdbcType=INTEGER} startDate,
) </if>
</insert> <if test="endDate != null">
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder" useGeneratedKeys="true"> endDate,
<!--@mbg.generated--> </if>
insert into thr_inv_order <if test="mainAction != null">
<trim prefix="(" suffix=")" suffixOverrides=","> mainAction,
<if test="billNo != null"> </if>
billNo, <if test="billType != null">
</if> billType,
<if test="billDate != null"> </if>
billDate, <if test="thirdSysFk != null">
</if> thirdSysFk,
<if test="startDate != null"> </if>
startDate, <if test="deptCode != null">
</if> deptCode,
<if test="endDate != null"> </if>
endDate, <if test="invCode != null">
</if> invCode,
<if test="mainAction != null"> </if>
mainAction, <if test="spaceCode != null">
</if> spaceCode,
<if test="billType != null"> </if>
billType, <if test="status != null">
</if> `status`,
<if test="thirdSysFk != null"> </if>
thirdSysFk, <if test="createTime != null">
</if> createTime,
<if test="deptCode != null"> </if>
deptCode, <if test="createUser != null">
</if> `createUser`,
<if test="invCode != null"> </if>
invCode, <if test="updateTime != null">
</if> updateTime,
<if test="spaceCode != null"> </if>
spaceCode, <if test="updateUser != null">
</if> updateUser,
<if test="status != null"> </if>
`status`, <if test="remark != null">
</if> remark,
<if test="createTime != null"> </if>
createTime, <if test="sourceType != null">
</if> sourceType,
<if test="createUser != null"> </if>
`createUser`, <if test="exMsg != null">
</if> exMsg,
<if test="updateTime != null"> </if>
updateTime, <if test="skProject != null">
</if> skProject,
<if test="updateUser != null"> </if>
updateUser, </trim>
</if> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="remark != null"> <if test="billNo != null">
remark, #{billNo,jdbcType=VARCHAR},
</if> </if>
<if test="sourceType != null"> <if test="billDate != null">
sourceType, #{billDate,jdbcType=TIMESTAMP},
</if> </if>
<if test="exMsg != null"> <if test="startDate != null">
exMsg, #{startDate,jdbcType=TIMESTAMP},
</if> </if>
<if test="skProject != null"> <if test="endDate != null">
skProject, #{endDate,jdbcType=TIMESTAMP},
</if> </if>
</trim> <if test="mainAction != null">
<trim prefix="values (" suffix=")" suffixOverrides=","> #{mainAction,jdbcType=VARCHAR},
<if test="billNo != null"> </if>
#{billNo,jdbcType=VARCHAR}, <if test="billType != null">
</if> #{billType,jdbcType=VARCHAR},
<if test="billDate != null"> </if>
#{billDate,jdbcType=TIMESTAMP}, <if test="thirdSysFk != null">
</if> #{thirdSysFk,jdbcType=VARCHAR},
<if test="startDate != null"> </if>
#{startDate,jdbcType=TIMESTAMP}, <if test="deptCode != null">
</if> #{deptCode,jdbcType=VARCHAR},
<if test="endDate != null"> </if>
#{endDate,jdbcType=TIMESTAMP}, <if test="invCode != null">
</if> #{invCode,jdbcType=VARCHAR},
<if test="mainAction != null"> </if>
#{mainAction,jdbcType=VARCHAR}, <if test="spaceCode != null">
</if> #{spaceCode,jdbcType=VARCHAR},
<if test="billType != null"> </if>
#{billType,jdbcType=VARCHAR}, <if test="status != null">
</if> #{status,jdbcType=TINYINT},
<if test="thirdSysFk != null"> </if>
#{thirdSysFk,jdbcType=VARCHAR}, <if test="createTime != null">
</if> #{createTime,jdbcType=TIMESTAMP},
<if test="deptCode != null"> </if>
#{deptCode,jdbcType=VARCHAR}, <if test="createUser != null">
</if> #{createUser,jdbcType=VARCHAR},
<if test="invCode != null"> </if>
#{invCode,jdbcType=VARCHAR}, <if test="updateTime != null">
</if> #{updateTime,jdbcType=TIMESTAMP},
<if test="spaceCode != null"> </if>
#{spaceCode,jdbcType=VARCHAR}, <if test="updateUser != null">
</if> #{updateUser,jdbcType=VARCHAR},
<if test="status != null"> </if>
#{status,jdbcType=TINYINT}, <if test="remark != null">
</if> #{remark,jdbcType=VARCHAR},
<if test="createTime != null"> </if>
#{createTime,jdbcType=TIMESTAMP}, <if test="sourceType != null">
</if> #{sourceType,jdbcType=INTEGER},
<if test="createUser != null"> </if>
#{createUser,jdbcType=VARCHAR}, <if test="exMsg != null">
</if> #{exMsg,jdbcType=VARCHAR},
<if test="updateTime != null"> </if>
#{updateTime,jdbcType=TIMESTAMP}, <if test="skProject != null">
</if> #{skProject,jdbcType=INTEGER},
<if test="updateUser != null"> </if>
#{updateUser,jdbcType=VARCHAR}, </trim>
</if> </insert>
<if test="remark != null"> <update id="updateByPrimaryKeySelective" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder">
#{remark,jdbcType=VARCHAR}, <!--@mbg.generated-->
</if> update thr_inv_order
<if test="sourceType != null"> <set>
#{sourceType,jdbcType=INTEGER}, <if test="billNo != null">
</if> billNo = #{billNo,jdbcType=VARCHAR},
<if test="exMsg != null"> </if>
#{exMsg,jdbcType=VARCHAR}, <if test="billDate != null">
</if> billDate = #{billDate,jdbcType=TIMESTAMP},
<if test="skProject != null"> </if>
#{skProject,jdbcType=INTEGER}, <if test="startDate != null">
</if> startDate = #{startDate,jdbcType=TIMESTAMP},
</trim> </if>
</insert> <if test="endDate != null">
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder"> endDate = #{endDate,jdbcType=TIMESTAMP},
<!--@mbg.generated--> </if>
update thr_inv_order <if test="mainAction != null">
<set> mainAction = #{mainAction,jdbcType=VARCHAR},
<if test="billNo != null"> </if>
billNo = #{billNo,jdbcType=VARCHAR}, <if test="billType != null">
</if> billType = #{billType,jdbcType=VARCHAR},
<if test="billDate != null"> </if>
billDate = #{billDate,jdbcType=TIMESTAMP}, <if test="thirdSysFk != null">
</if> thirdSysFk = #{thirdSysFk,jdbcType=VARCHAR},
<if test="startDate != null"> </if>
startDate = #{startDate,jdbcType=TIMESTAMP}, <if test="deptCode != null">
</if> deptCode = #{deptCode,jdbcType=VARCHAR},
<if test="endDate != null"> </if>
endDate = #{endDate,jdbcType=TIMESTAMP}, <if test="invCode != null">
</if> invCode = #{invCode,jdbcType=VARCHAR},
<if test="mainAction != null"> </if>
mainAction = #{mainAction,jdbcType=VARCHAR}, <if test="spaceCode != null">
</if> spaceCode = #{spaceCode,jdbcType=VARCHAR},
<if test="billType != null"> </if>
billType = #{billType,jdbcType=VARCHAR}, <if test="status != null">
</if> `status` = #{status,jdbcType=TINYINT},
<if test="thirdSysFk != null"> </if>
thirdSysFk = #{thirdSysFk,jdbcType=VARCHAR}, <if test="createTime != null">
</if> createTime = #{createTime,jdbcType=TIMESTAMP},
<if test="deptCode != null"> </if>
deptCode = #{deptCode,jdbcType=VARCHAR}, <if test="createUser != null">
</if> `createUser` = #{createUser,jdbcType=VARCHAR},
<if test="invCode != null"> </if>
invCode = #{invCode,jdbcType=VARCHAR}, <if test="updateTime != null">
</if> updateTime = #{updateTime,jdbcType=TIMESTAMP},
<if test="spaceCode != null"> </if>
spaceCode = #{spaceCode,jdbcType=VARCHAR}, <if test="updateUser != null">
</if> updateUser = #{updateUser,jdbcType=VARCHAR},
<if test="status != null"> </if>
`status` = #{status,jdbcType=TINYINT}, <if test="remark != null">
</if> remark = #{remark,jdbcType=VARCHAR},
<if test="createTime != null"> </if>
createTime = #{createTime,jdbcType=TIMESTAMP}, <if test="sourceType != null">
</if> sourceType = #{sourceType,jdbcType=INTEGER},
<if test="createUser != null"> </if>
`createUser` = #{createUser,jdbcType=VARCHAR}, <if test="exMsg != null">
</if> exMsg = #{exMsg,jdbcType=VARCHAR},
<if test="updateTime != null"> </if>
updateTime = #{updateTime,jdbcType=TIMESTAMP}, <if test="skProject != null">
</if> skProject = #{skProject,jdbcType=INTEGER},
<if test="updateUser != null"> </if>
updateUser = #{updateUser,jdbcType=VARCHAR}, </set>
</if> where id = #{id,jdbcType=INTEGER}
<if test="remark != null"> </update>
remark = #{remark,jdbcType=VARCHAR}, <update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder">
</if> <!--@mbg.generated-->
<if test="sourceType != null"> update thr_inv_order
sourceType = #{sourceType,jdbcType=INTEGER}, set billNo = #{billNo,jdbcType=VARCHAR},
</if> billDate = #{billDate,jdbcType=TIMESTAMP},
<if test="exMsg != null"> startDate = #{startDate,jdbcType=TIMESTAMP},
exMsg = #{exMsg,jdbcType=VARCHAR}, endDate = #{endDate,jdbcType=TIMESTAMP},
</if> mainAction = #{mainAction,jdbcType=VARCHAR},
<if test="skProject != null"> billType = #{billType,jdbcType=VARCHAR},
skProject = #{skProject,jdbcType=INTEGER}, thirdSysFk = #{thirdSysFk,jdbcType=VARCHAR},
</if> deptCode = #{deptCode,jdbcType=VARCHAR},
</set> invCode = #{invCode,jdbcType=VARCHAR},
where id = #{id,jdbcType=INTEGER} spaceCode = #{spaceCode,jdbcType=VARCHAR},
</update> `status` = #{status,jdbcType=TINYINT},
<update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder"> createTime = #{createTime,jdbcType=TIMESTAMP},
<!--@mbg.generated--> `createUser` = #{createUser,jdbcType=VARCHAR},
update thr_inv_order updateTime = #{updateTime,jdbcType=TIMESTAMP},
set billNo = #{billNo,jdbcType=VARCHAR}, updateUser = #{updateUser,jdbcType=VARCHAR},
billDate = #{billDate,jdbcType=TIMESTAMP}, remark = #{remark,jdbcType=VARCHAR},
startDate = #{startDate,jdbcType=TIMESTAMP}, sourceType = #{sourceType,jdbcType=INTEGER},
endDate = #{endDate,jdbcType=TIMESTAMP}, exMsg = #{exMsg,jdbcType=VARCHAR},
mainAction = #{mainAction,jdbcType=VARCHAR}, skProject = #{skProject,jdbcType=INTEGER}
billType = #{billType,jdbcType=VARCHAR}, where id = #{id,jdbcType=INTEGER}
thirdSysFk = #{thirdSysFk,jdbcType=VARCHAR}, </update>
deptCode = #{deptCode,jdbcType=VARCHAR},
invCode = #{invCode,jdbcType=VARCHAR},
spaceCode = #{spaceCode,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
createTime = #{createTime,jdbcType=TIMESTAMP},
`createUser` = #{createUser,jdbcType=VARCHAR},
updateTime = #{updateTime,jdbcType=TIMESTAMP},
updateUser = #{updateUser,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
sourceType = #{sourceType,jdbcType=INTEGER},
exMsg = #{exMsg,jdbcType=VARCHAR},
skProject = #{skProject,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="filterThrInvOrder" parameterType="com.glxp.api.req.thrsys.FilterThrInvOrderRequest" <select id="filterThrInvOrder" parameterType="com.glxp.api.req.thrsys.FilterThrInvOrderRequest"
resultType="com.glxp.api.entity.thrsys.ThrInvOrder"> resultType="com.glxp.api.res.thrsys.ThrInvOrderResponse">
SELECT thr_inv_order.* SELECT tio.*, bbt.name billTypeName, aw.name invName
FROM thr_inv_order FROM thr_inv_order tio
<where> left join basic_bussiness_type bbt on tio.billType = bbt.action
<if test="billNo != '' and billNo != null"> left join auth_warehouse aw on tio.invCode = aw.code
AND billNo like concat('%', #{billNo}, '%') <where>
</if> <if test="billNo != '' and billNo != null">
<if test="billType != '' and billType != null"> AND billNo like concat('%', #{billNo}, '%')
AND billType = #{billType} </if>
</if> <if test="billType != '' and billType != null">
<if test="thirdSysFk != '' and thirdSysFk != null"> AND billType = #{billType}
AND thirdSysFk = #{thirdSysFk} </if>
</if> <if test="thirdSysFk != '' and thirdSysFk != null">
<if test="startDate != null and startDate != ''"> AND tio.thirdSysFk = #{thirdSysFk}
<![CDATA[ </if>
<if test="startDate != null and startDate != ''">
<![CDATA[
and DATE_FORMAT(billdate, '%Y-%m-%d') >= DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(billdate, '%Y-%m-%d') >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
]]> ]]>
</if> </if>
<if test="endDate != null and endDate != ''"> <if test="endDate != null and endDate != ''">
<![CDATA[ <![CDATA[
and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
]]> ]]>
</if> </if>
<if test="sourceType != '' and sourceType != null"> <if test="sourceType != '' and sourceType != null">
AND sourceType = #{sourceType} AND sourceType = #{sourceType}
</if> </if>
</where> </where>
ORDER BY thr_inv_order.billdate DESC ORDER BY tio.billdate DESC
</select> </select>
</mapper> </mapper>

@ -26,6 +26,9 @@
<if test="remark != null"> <if test="remark != null">
remark=#{remark}, remark=#{remark},
</if> </if>
<if test="fromCorp != null">
fromCorp=#{fromCorp},
</if>
</trim> </trim>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
@ -34,7 +37,7 @@
resultType="com.glxp.api.entity.thrsys.ThrSystemBusApiEntity"> resultType="com.glxp.api.entity.thrsys.ThrSystemBusApiEntity">
SELECT thr_system_bus_api.*, tbo.name thirdBuyName SELECT thr_system_bus_api.*, tbo.name thirdBuyName
FROM thr_system_bus_api FROM thr_system_bus_api
left join thr_bustype_origin tbo on thr_system_bus_api.thirdBuyCode = tbo.action left join thr_bustype_origin tbo on thr_system_bus_api.thirdBuyCode = tbo.action
<where> <where>
<if test="key != '' and key != null"> <if test="key != '' and key != null">
AND code = #{code} AND code = #{code}
@ -55,27 +58,27 @@
<insert id="insertSysBusApi" keyProperty="id" <insert id="insertSysBusApi" keyProperty="id"
parameterType="com.glxp.api.entity.thrsys.ThrSystemBusApiEntity"> parameterType="com.glxp.api.entity.thrsys.ThrSystemBusApiEntity">
insert insert
ignore ignore
INTO thr_system_bus_api INTO thr_system_bus_api
(`code`, `name`, thirdBuyCode, `thirdSys`, url, `type`, remark) (`code`, `name`, thirdBuyCode, `thirdSys`, url, `type`, remark, fromCorp)
values (#{code}, values (#{code},
#{name}, #{name},
#{thirdBuyCode}, #{thirdBuyCode},
#{thirdSys}, #{thirdSys},
#{url}, #{url},
#{type}, #{type},
#{remark}) #{remark}, #{fromCorp})
</insert> </insert>
<insert id="saveBusTypes"> <insert id="saveBusTypes">
insert into thr_system_bus_api (code, `name`, thirdBuyCode, thirdSys, type) insert into thr_system_bus_api (code, `name`, thirdBuyCode, thirdSys, type, fromCorp)
values values
<foreach collection="list" index="index" item="item" separator=","> <foreach collection="list" index="index" item="item" separator=",">
(#{item.code}, (#{item.code},
#{item.name}, #{item.name},
#{item.thirdBuyCode}, #{item.thirdBuyCode},
#{item.thirdSys}, #{item.thirdSys},
#{item.type}) #{item.type}#{item.fromCorp})
</foreach> </foreach>
</insert> </insert>

@ -648,6 +648,9 @@ CALL Pro_Temp_ColumnWork('thr_inv_order_detail', 'supId',
CALL Pro_Temp_ColumnWork('basic_sk_project_detail', 'supId', CALL Pro_Temp_ColumnWork('basic_sk_project_detail', 'supId',
' varchar(30) NULL DEFAULT NULL COMMENT ''供应商ID'' AFTER `remark`', 1); ' varchar(30) NULL DEFAULT NULL COMMENT ''供应商ID'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('basic_sk_project_detail', 'thrName',
' varchar(30) NULL DEFAULT NULL COMMENT ''供应商ID'' AFTER `remark`', 1);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`, INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
`itrCache`, `fromType`, `time`, `dlLastTime`) `itrCache`, `fromType`, `time`, `dlLastTime`)
@ -713,3 +716,5 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailInvBatchNo',
CALL Pro_Temp_ColumnWork('io_code_temp', 'errUdiCode', 'varchar(255) NULL DEFAULT NULL COMMENT ''去掉错误符号异常UDI码''', 1); CALL Pro_Temp_ColumnWork('io_code_temp', 'errUdiCode', 'varchar(255) NULL DEFAULT NULL COMMENT ''去掉错误符号异常UDI码''', 1);
CALL Pro_Temp_ColumnWork('io_code', 'errUdiCode', 'varchar(255) NULL DEFAULT NULL COMMENT ''去掉错误符号异常UDI码''', 1); CALL Pro_Temp_ColumnWork('io_code', 'errUdiCode', 'varchar(255) NULL DEFAULT NULL COMMENT ''去掉错误符号异常UDI码''', 1);
CALL Pro_Temp_ColumnWork('thr_system_bus_api', 'fromCorp', 'varchar(255) NULL DEFAULT NULL COMMENT ''配置默认往来单位''', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'fromCorp', 'varchar(255) NULL DEFAULT NULL COMMENT ''配置默认往来单位''', 1);

Loading…
Cancel
Save