feat: 0523开发论证功能
parent
0d9fc95ce0
commit
b70f4136cf
@ -0,0 +1,9 @@
|
|||||||
|
package com.glxp.api.dao.purchase;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.glxp.api.entity.purchase.PurApplyArgument;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PurApplyArgumentMapper extends BaseMapper<PurApplyArgument> {
|
||||||
|
}
|
@ -0,0 +1,169 @@
|
|||||||
|
package com.glxp.api.entity.purchase;
|
||||||
|
|
||||||
|
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(description="udi_wms_ct.pur_apply_argument")
|
||||||
|
@Data
|
||||||
|
@TableName(value = "udi_wms_ct.pur_apply_argument")
|
||||||
|
public class PurApplyArgument implements Serializable {
|
||||||
|
@TableId(value = "id", type = IdType.INPUT)
|
||||||
|
@ApiModelProperty(value="")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单外键
|
||||||
|
*/
|
||||||
|
@TableField(value = "orderIdFk")
|
||||||
|
@ApiModelProperty(value="订单外键")
|
||||||
|
private String orderIdFk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单详情外键
|
||||||
|
*/
|
||||||
|
@TableField(value = "orderDetailIdFk")
|
||||||
|
@ApiModelProperty(value="订单详情外键")
|
||||||
|
private String orderDetailIdFk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申领单据号
|
||||||
|
*/
|
||||||
|
@TableField(value = "applyBillNo")
|
||||||
|
@ApiModelProperty(value="申领单据号")
|
||||||
|
private String applyBillNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前仓库
|
||||||
|
*/
|
||||||
|
@TableField(value = "invCode")
|
||||||
|
@ApiModelProperty(value="当前仓库")
|
||||||
|
private String invCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField(value = "deptCode")
|
||||||
|
@ApiModelProperty(value="所属部门")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属部门名字
|
||||||
|
*/
|
||||||
|
@TableField(value = "deptName")
|
||||||
|
@ApiModelProperty(value="所属部门名字")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField(value = "`createUser`")
|
||||||
|
@ApiModelProperty(value="创建人")
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField(value = "`createName`")
|
||||||
|
@ApiModelProperty(value="创建人")
|
||||||
|
private String createName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "createTime")
|
||||||
|
@ApiModelProperty(value="创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
@TableField(value = "updateUser")
|
||||||
|
@ApiModelProperty(value="更新人")
|
||||||
|
private String updateUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "updateTime")
|
||||||
|
@ApiModelProperty(value="更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品ID
|
||||||
|
*/
|
||||||
|
@TableField(value = "productId")
|
||||||
|
@ApiModelProperty(value="产品ID")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "productName")
|
||||||
|
@ApiModelProperty(value="产品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "`count`")
|
||||||
|
@ApiModelProperty(value="数量")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@TableField(value = "measname")
|
||||||
|
@ApiModelProperty(value="单位")
|
||||||
|
private String measname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置要求及主要技术参数
|
||||||
|
*/
|
||||||
|
@TableField(value = "mainParam")
|
||||||
|
@ApiModelProperty(value="配置要求及主要技术参数")
|
||||||
|
private String mainParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请理由
|
||||||
|
*/
|
||||||
|
@TableField(value = "applicationReason")
|
||||||
|
@ApiModelProperty(value="申请理由")
|
||||||
|
private String applicationReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 效益预测
|
||||||
|
*/
|
||||||
|
@TableField(value = "benefitPrediction")
|
||||||
|
@ApiModelProperty(value="效益预测")
|
||||||
|
private String benefitPrediction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配套条件
|
||||||
|
*/
|
||||||
|
@TableField(value = "supportCondition")
|
||||||
|
@ApiModelProperty(value="配套条件")
|
||||||
|
private String supportCondition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用科室人员配备情况
|
||||||
|
*/
|
||||||
|
@TableField(value = "supportPerson")
|
||||||
|
@ApiModelProperty(value="使用科室人员配备情况")
|
||||||
|
private String supportPerson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 论证状态
|
||||||
|
*/
|
||||||
|
@TableField(value = "argStatus")
|
||||||
|
@ApiModelProperty(value="论证状态")
|
||||||
|
private Integer argStatus;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package com.glxp.api.service.purchase.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.auth.DeptEntity;
|
||||||
|
import com.glxp.api.entity.purchase.PurApplyDetailEntity;
|
||||||
|
import com.glxp.api.entity.purchase.PurApplyEntity;
|
||||||
|
import com.glxp.api.service.auth.CustomerService;
|
||||||
|
import com.glxp.api.service.auth.DeptService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.glxp.api.entity.purchase.PurApplyArgument;
|
||||||
|
import com.glxp.api.dao.purchase.PurApplyArgumentMapper;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class PurApplyArgumentService extends ServiceImpl<PurApplyArgumentMapper, PurApplyArgument> {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
PurApplyDetailService purApplyDetailService;
|
||||||
|
@Resource
|
||||||
|
DeptService deptService;
|
||||||
|
@Resource
|
||||||
|
CustomerService customerService;
|
||||||
|
|
||||||
|
public void genPurApplyArguments(PurApplyEntity purApplyEntity) {
|
||||||
|
Long id = purApplyEntity.getId();
|
||||||
|
String billNo = purApplyEntity.getBillNo();
|
||||||
|
String invCode = purApplyEntity.getInvCode();
|
||||||
|
String deptCode = purApplyEntity.getDeptCode();
|
||||||
|
DeptEntity dept = deptService.selectByCode(deptCode);
|
||||||
|
String deptName = dept.getName();
|
||||||
|
Date date = new Date();
|
||||||
|
AuthAdmin userBean = customerService.getUserBean();
|
||||||
|
String userId = userBean.getId() + "";
|
||||||
|
String employeeName = userBean.getEmployeeName();
|
||||||
|
|
||||||
|
QueryWrapper<PurApplyDetailEntity> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("orderIdFk",id);
|
||||||
|
List<PurApplyDetailEntity> list = purApplyDetailService.list(qw);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)){
|
||||||
|
List<PurApplyArgument> purApplyArguments = new ArrayList<>(list.size());
|
||||||
|
list.forEach( item -> {
|
||||||
|
PurApplyArgument purApplyArgument = new PurApplyArgument();
|
||||||
|
purApplyArgument.setOrderIdFk(String.valueOf(id));
|
||||||
|
purApplyArgument.setOrderDetailIdFk(String.valueOf(item.getId()));
|
||||||
|
purApplyArgument.setApplyBillNo(billNo);
|
||||||
|
purApplyArgument.setInvCode(invCode);
|
||||||
|
purApplyArgument.setDeptCode(deptCode);
|
||||||
|
purApplyArgument.setDeptName(deptName);
|
||||||
|
purApplyArgument.setCreateUser(userId);
|
||||||
|
purApplyArgument.setCreateTime(date);
|
||||||
|
purApplyArgument.setCreateName(employeeName);
|
||||||
|
purApplyArgument.setProductId(item.getProductId());
|
||||||
|
purApplyArgument.setProductName(item.getProductName());
|
||||||
|
purApplyArgument.setCount(item.getCount());
|
||||||
|
purApplyArgument.setMeasname(item.getMeasname());
|
||||||
|
|
||||||
|
purApplyArguments.add(purApplyArgument);
|
||||||
|
});
|
||||||
|
saveBatch(purApplyArguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
<?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.purchase.PurApplyArgumentMapper">
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, orderIdFk, orderDetailIdFk, applyBillNo, invCode, deptCode, deptName, `createUser`,
|
||||||
|
createTime, updateUser, updateTime, productId, productName, `count`, measname, mainParam,
|
||||||
|
applicationReason, benefitPrediction, supportCondition, supportPerson, argStatus
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue