采购计划,采购订单等相关修改

dev
anthonywj 2 years ago
parent 950301315d
commit f66705d82b

@ -114,7 +114,7 @@ public class InvWarehouseController extends BaseController {
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@GetMapping("spms/inv/warehouse/filterGroupBySpuse") @GetMapping("spms/inv/warehouse/filterGroupBySpuse")
public BaseResponse filterGroupBySpuse(FilterInvWarehouseRequest filterInvWarehouseRequest) { public BaseResponse filterGroupBySpuse(FilterInvWarehouseRequest filterInvWarehouseRequest) {
filterInvWarehouseRequest.setUserId(getUserId()); // filterInvWarehouseRequest.setUserId(getUserId());
List<InvWarehouseEntity> invSubWarehouseEntities = invWarehouseService.filterGroupBySpuse(filterInvWarehouseRequest); List<InvWarehouseEntity> invSubWarehouseEntities = invWarehouseService.filterGroupBySpuse(filterInvWarehouseRequest);
return ResultVOUtils.success(invSubWarehouseEntities); return ResultVOUtils.success(invSubWarehouseEntities);
} }

@ -134,6 +134,9 @@ public class IoPurChangeService {
purPlanEntity.setDeptCode(purApplyEntity.getTargetDeptCode()); purPlanEntity.setDeptCode(purApplyEntity.getTargetDeptCode());
purPlanEntity.setCreateUser(purApplyEntity.getAuditUser()); purPlanEntity.setCreateUser(purApplyEntity.getAuditUser());
purPlanEntity.setApplyCreateUser(purApplyEntity.getCreateUser()); purPlanEntity.setApplyCreateUser(purApplyEntity.getCreateUser());
purPlanEntity.setApplyAuditUser(purApplyEntity.getAuditUser());
purPlanEntity.setApplyInv(purApplyEntity.getInvCode());
purPlanEntity.setApplyBillNo(purApplyEntity.getBillNo());
purPlanEntity.setApplyRemark(purApplyEntity.getRemark()); purPlanEntity.setApplyRemark(purApplyEntity.getRemark());
if (basicBusTypeChangeEntity.getBusBeforeTime() != null) { if (basicBusTypeChangeEntity.getBusBeforeTime() != null) {
purPlanEntity.setCreateTime(MsDateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime())); purPlanEntity.setCreateTime(MsDateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime()));
@ -220,6 +223,8 @@ public class IoPurChangeService {
purOrderEntity.setDeptCode(purPlanEntity.getDeptCode()); purOrderEntity.setDeptCode(purPlanEntity.getDeptCode());
purOrderEntity.setApplyRemark(purPlanEntity.getApplyRemark()); purOrderEntity.setApplyRemark(purPlanEntity.getApplyRemark());
purOrderEntity.setApplyCreateUser(purPlanEntity.getApplyCreateUser()); purOrderEntity.setApplyCreateUser(purPlanEntity.getApplyCreateUser());
purOrderEntity.setApplyAuditUser(purPlanEntity.getApplyAuditUser());
purOrderEntity.setApplyInv(purPlanEntity.getApplyInv());
purOrderEntity.setCreateUser(purPlanEntity.getAuditUser()); purOrderEntity.setCreateUser(purPlanEntity.getAuditUser());
purOrderEntity.setUpdateUser(purPlanEntity.getAuditUser()); purOrderEntity.setUpdateUser(purPlanEntity.getAuditUser());
if (basicBusTypeChangeEntity.getBusBeforeTime() != null) { if (basicBusTypeChangeEntity.getBusBeforeTime() != null) {
@ -252,13 +257,9 @@ public class IoPurChangeService {
// 更新计划表信息插入订单单号 // 更新计划表信息插入订单单号
PurPlanEntity purPlanEntity1 = new PurPlanEntity(); PurPlanEntity purPlanEntity1 = new PurPlanEntity();
purPlanEntity1.setId(purPlanEntity.getId()); purPlanEntity1.setId(purPlanEntity.getId());
purPlanEntity1.setStockOrderNo(billNos.substring(0)); purPlanEntity1.setStockOrderNo(billNos);
// purPlanEntity.sets(true);
purPlanService.update(purPlanEntity1); purPlanService.update(purPlanEntity1);
} }
// if (basicBusTypeChangeEntity != null && StrUtil.isNotEmpty(basicBusTypeChangeEntity.getTargetBusAction()) && basicBusTypeChangeEntity.isEnable() == true) {
// purPlanGen(purPlanEntity);
// }
} }
} }

@ -187,6 +187,7 @@ public class PurPlanController {
purPlanEntity.setStatus(postPurPlanRequest.getEditStatus()); purPlanEntity.setStatus(postPurPlanRequest.getEditStatus());
purPlanService.update(purPlanEntity); purPlanService.update(purPlanEntity);
if (purPlanEntity.getStatus() == 3) { if (purPlanEntity.getStatus() == 3) {
purPlanEntity = purPlanService.selectById(purPlanEntity.getId());
purChangeService.purPlanChange(purPlanEntity); purChangeService.purPlanChange(purPlanEntity);
// generateDocument(purPlanEntity); // generateDocument(purPlanEntity);
} }

@ -1,6 +1,8 @@
package com.glxp.api.dao.purchase; package com.glxp.api.dao.purchase;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.purchase.PurOrderEntity;
import com.glxp.api.entity.purchase.PurPlanEntity; import com.glxp.api.entity.purchase.PurPlanEntity;
import com.glxp.api.req.purchase.PurPlanRequest; import com.glxp.api.req.purchase.PurPlanRequest;
import com.glxp.api.res.purchase.PurPlanResponse; import com.glxp.api.res.purchase.PurPlanResponse;
@ -10,16 +12,10 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface PurPlanDao { public interface PurPlanDao extends BaseMapperPlus<PurPlanDao, PurPlanEntity, PurPlanEntity> {
List<PurPlanResponse> queryPageList(PurPlanRequest purPlanRequest); List<PurPlanResponse> queryPageList(PurPlanRequest purPlanRequest);
Boolean insert(PurPlanEntity purPlanRequest);
Boolean update(PurPlanEntity purPlanRequest);
Boolean deleteByIds(@Param("ids") List<Integer> ids); Boolean deleteByIds(@Param("ids") List<Integer> ids);
Boolean deleteById(@Param("id") long id);
} }

@ -111,6 +111,13 @@ public class PurOrderEntity {
@TableField(value = "applyAuditUser") @TableField(value = "applyAuditUser")
private String applyAuditUser; private String applyAuditUser;
/**
*
*/
@TableField(value = "applyInv")
private String applyInv;
/** /**
* *
*/ */
@ -141,6 +148,7 @@ public class PurOrderEntity {
@TableField(value = "arrivalTime") @TableField(value = "arrivalTime")
private Date arrivalTime; private Date arrivalTime;
public static final String COL_ID = "id"; public static final String COL_ID = "id";
public static final String COL_BILLNO = "billNo"; public static final String COL_BILLNO = "billNo";

@ -4,13 +4,15 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date; import java.util.Date;
import lombok.Data; import lombok.Data;
@Data @Data
@TableName(value = "pur_plan") @TableName(value = "pur_plan")
public class PurPlanEntity { public class PurPlanEntity {
@TableId(value = "id", type = IdType.INPUT) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
/** /**
@ -103,6 +105,12 @@ public class PurPlanEntity {
@TableField(value = "applyCreateUser") @TableField(value = "applyCreateUser")
private String applyCreateUser; private String applyCreateUser;
/**
*
*/
@TableField(value = "applyInv")
private String applyInv;
/** /**
* *
*/ */
@ -175,4 +183,4 @@ public class PurPlanEntity {
public static final String COL_APPLYBILLNO = "applyBillNo"; public static final String COL_APPLYBILLNO = "applyBillNo";
public static final String COL_STOCKORDERNO = "stockOrderNo"; public static final String COL_STOCKORDERNO = "stockOrderNo";
} }

@ -63,6 +63,7 @@ public class PurOrderResponse {
private String applyAuditBy; //申购审核人 private String applyAuditBy; //申购审核人
private String applyRemark; //申购说明 private String applyRemark; //申购说明
private String applyBillNo; //申购单据号,多单以逗号隔开 private String applyBillNo; //申购单据号,多单以逗号隔开
private String applyInvName;
private String stockOrderNo; private String stockOrderNo;

@ -1,5 +1,6 @@
package com.glxp.api.res.purchase; package com.glxp.api.res.purchase;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -61,6 +62,7 @@ public class PurPlanResponse {
private String applyCreateBy; //申购人 private String applyCreateBy; //申购人
private String applyAuditBy; //申购审核人 private String applyAuditBy; //申购审核人
private String applyInvName;
private String applyRemark; //申购说明 private String applyRemark; //申购说明
private String applyBillNo; //申购单据号,多单以逗号隔开 private String applyBillNo; //申购单据号,多单以逗号隔开

@ -1,7 +1,6 @@
package com.glxp.api.service.purchase; package com.glxp.api.service.purchase;
import com.glxp.api.entity.purchase.PurPlanEntity; import com.glxp.api.entity.purchase.PurPlanEntity;
import com.glxp.api.req.purchase.PurPlanRequest; import com.glxp.api.req.purchase.PurPlanRequest;
import com.glxp.api.res.purchase.PurPlanResponse; import com.glxp.api.res.purchase.PurPlanResponse;
@ -21,5 +20,7 @@ public interface PurPlanService {
Boolean deleteById(long id); Boolean deleteById(long id);
PurPlanEntity selectById(Long id);
} }

@ -35,12 +35,12 @@ public class PurPlanServiceImpl implements PurPlanService {
@Override @Override
public Boolean insert(PurPlanEntity purPlanRequest) { public Boolean insert(PurPlanEntity purPlanRequest) {
return purPlanDao.insert(purPlanRequest); return purPlanDao.insert(purPlanRequest) > 0;
} }
@Override @Override
public Boolean update(PurPlanEntity purPlanRequest) { public Boolean update(PurPlanEntity purPlanRequest) {
return purPlanDao.update(purPlanRequest); return purPlanDao.updateById(purPlanRequest) > 0;
} }
@Override @Override
@ -50,6 +50,11 @@ public class PurPlanServiceImpl implements PurPlanService {
@Override @Override
public Boolean deleteById(long id) { public Boolean deleteById(long id) {
return purPlanDao.deleteById(id); return purPlanDao.deleteById(id) > 0;
}
@Override
public PurPlanEntity selectById(Long id) {
return purPlanDao.selectById(id);
} }
} }

@ -40,6 +40,7 @@
ab.employeeName auditUserName, ab.employeeName auditUserName,
db.employeeName applyCreateBy, db.employeeName applyCreateBy,
auth_warehouse.NAME invName, auth_warehouse.NAME invName,
aw1.name applyInvName,
auth_dept.`name` deptName, auth_dept.`name` deptName,
basic_corp.name supName basic_corp.name supName
FROM pur_order FROM pur_order
@ -49,6 +50,7 @@
LEFT JOIN auth_warehouse ON pur_order.invCode = auth_warehouse.`code` LEFT JOIN auth_warehouse ON pur_order.invCode = auth_warehouse.`code`
LEFT JOIN auth_dept ON auth_dept.CODE = pur_order.deptCode LEFT JOIN auth_dept ON auth_dept.CODE = pur_order.deptCode
left join basic_corp on pur_order.supId = basic_corp.erpId left join basic_corp on pur_order.supId = basic_corp.erpId
left join auth_warehouse aw1 on pur_order.applyInv = aw1.`code`
<where> <where>
<if test="billNo != '' and billNo != null"> <if test="billNo != '' and billNo != null">
AND billNo = #{billNo} AND billNo = #{billNo}

@ -2,49 +2,57 @@
<!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.purchase.PurPlanDao"> <mapper namespace="com.glxp.api.dao.purchase.PurPlanDao">
<select id="queryPageList" parameterType="com.glxp.api.req.purchase.PurPlanRequest" <select id="queryPageList" parameterType="com.glxp.api.req.purchase.PurPlanRequest"
resultType="com.glxp.api.res.purchase.PurPlanResponse"> resultType="com.glxp.api.res.purchase.PurPlanResponse">
SELECT pur_plan.*,
SELECT cb.employeeName createUserName,
pur_plan.*, ab.employeeName auditUserName,
cb.employeeName createUserName, db.employeeName applyCreateBy,
ab.employeeName auditUserName, auth_warehouse.NAME invName,
auth_warehouse.NAME invName, aw1.name applyInvName,
auth_dept.`name` deptName auth_dept.`name` deptName
FROM FROM pur_plan
pur_plan LEFT JOIN auth_user cb ON pur_plan.createUser = cb.id
LEFT JOIN auth_user cb ON pur_plan.createUser = cb.id LEFT JOIN auth_user ab ON pur_plan.auditUser = ab.id
LEFT JOIN auth_user ab ON pur_plan.auditUser = ab.id LEFT JOIN auth_user db ON pur_plan.applyCreateUser = db.id
LEFT JOIN auth_warehouse ON pur_plan.invCode = auth_warehouse.`code` LEFT JOIN auth_warehouse ON pur_plan.invCode = auth_warehouse.`code`
LEFT JOIN auth_dept ON auth_dept.CODE = pur_plan.deptCode LEFT JOIN auth_dept ON auth_dept.CODE = pur_plan.deptCode
left join auth_warehouse aw1 on pur_plan.applyInv = aw1.`code`
<where> <where>
<if test="billNo != '' and billNo != null"> <if test="billNo != '' and billNo != null">
AND billNo = #{billNo} AND billNo = #{billNo}
</if> </if>
<if test="startDate != null and startDate !=''"> <if test="startDate != null and startDate != ''">
<![CDATA[ and DATE_FORMAT(pur_plan.createTime,'%Y-%m-%d')>= #{startDate}]]> <![CDATA[
and DATE_FORMAT(pur_plan.createTime, '%Y-%m-%d') >= #{startDate}
]]>
</if> </if>
<if test="endDate != null and endDate !=''"> <if test="endDate != null and endDate != ''">
<![CDATA[ and DATE_FORMAT(pur_plan.createTime,'%Y-%m-%d') <= #{endDate}]]> <![CDATA[
and DATE_FORMAT(pur_plan.createTime, '%Y-%m-%d') <= #{endDate}
]]>
</if> </if>
<if test="startAuditDate != null and startAuditDate !=''"> <if test="startAuditDate != null and startAuditDate != ''">
<![CDATA[ and DATE_FORMAT(pur_plan.auditTime,'%Y-%m-%d')>= #{startAuditDate}]]> <![CDATA[
and DATE_FORMAT(pur_plan.auditTime, '%Y-%m-%d') >= #{startAuditDate}
]]>
</if> </if>
<if test="endAuditDate != null and endAuditDate !=''"> <if test="endAuditDate != null and endAuditDate != ''">
<![CDATA[ and DATE_FORMAT(pur_plan.auditTime,'%Y-%m-%d') <= #{endAuditDate}]]> <![CDATA[
and DATE_FORMAT(pur_plan.auditTime, '%Y-%m-%d') <= #{endAuditDate}
]]>
</if> </if>
<if test="status!=null and status!=10 and status!=11"> <if test="status != null and status != 10 and status != 11">
and pur_plan.status = #{status} and pur_plan.status = #{status}
</if> </if>
<if test="status ==10"> <if test="status == 10">
and ( pur_plan.status = 3 or pur_plan.status=2 or pur_plan.status=4) and (pur_plan.status = 3 or pur_plan.status = 2 or pur_plan.status = 4)
</if> </if>
<if test="status ==11"> <if test="status == 11">
and ( pur_plan.status = 1 or pur_plan.status=2 or pur_plan.status=4) and (pur_plan.status = 1 or pur_plan.status = 2 or pur_plan.status = 4)
</if> </if>
<if test="status ==12"> <if test="status == 12">
and (pur_plan.status=3) and (pur_plan.status = 3)
</if> </if>
<if test="deptCode != '' and deptCode != null"> <if test="deptCode != '' and deptCode != null">
AND deptCode = #{deptCode} AND deptCode = #{deptCode}
@ -63,8 +71,8 @@
</if> </if>
</where> </where>
<choose> <choose>
<when test="(orderBy!=null ) and (sort=='desc' or sort=='asc')"> <when test="(orderBy != null) and (sort == 'desc' or sort == 'asc')">
order by ${orderBy} ${sort} order by ${orderBy} ${sort}
</when> </when>
<otherwise> <otherwise>
ORDER BY pur_plan.updateTime DESC ORDER BY pur_plan.updateTime DESC
@ -72,80 +80,12 @@
</choose> </choose>
</select> </select>
<insert id="insert" keyProperty="id"
parameterType="com.glxp.api.entity.purchase.PurPlanEntity" useGeneratedKeys="true">
replace
INTO pur_plan
(
billNo,billDate,status,billType,remark,invCode,
deptCode,createUser,createTime,auditUser,auditTime,updateTime,auditRemark
,applyCreateUser,applyAuditUser,applyRemark,applyBillNo,stockOrderNo,emergency,arrivalTime
)
values (
#{billNo},
#{billDate},
#{status},
#{billType},
#{remark},
#{invCode},
#{deptCode},
#{createUser},
#{createTime},
#{auditUser},
#{auditTime},
#{updateTime},
#{auditRemark},
#{applyCreateUser},
#{applyAuditUser},
#{applyRemark},
#{applyBillNo},
#{stockOrderNo},
#{emergency},#{arrivalTime}
)
</insert>
<delete id="deleteByIds" parameterType="java.util.List"> <delete id="deleteByIds" parameterType="java.util.List">
DELETE FROM pur_plan WHERE id in DELETE
FROM pur_plan WHERE id in
<foreach collection="ids" item="item" open="(" separator="," close=")"> <foreach collection="ids" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</delete> </delete>
<update id="update" parameterType="com.glxp.api.entity.purchase.PurPlanEntity">
UPDATE pur_plan
<trim prefix="set" suffixOverrides=",">
<if test="billNo != null">billNo=#{billNo},</if>
<if test="billDate != null">billDate=#{billDate},</if>
<if test="status != null">status=#{status},</if>
<if test="billType != null">billType=#{billType},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="invCode != null">invCode=#{invCode},</if>
<if test="deptCode != null">deptCode=#{deptCode},</if>
<if test="auditUser != null">auditUser=#{auditUser},</if>
<if test="auditTime != null">auditTime=#{auditTime},</if>
<if test="createUser != null">createUser=#{createUser},</if>
<if test="createTime != null">createTime=#{createTime},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="updateUser != null">updateUser=#{updateUser},</if>
<if test="auditRemark != null">auditRemark=#{auditRemark},</if>
<if test="applyCreateUser != null">applyCreateUser=#{applyCreateUser},</if>
<if test="applyAuditUser != null">applyAuditUser=#{applyAuditUser},</if>
<if test="applyRemark != null">applyRemark=#{applyRemark},</if>
<if test="applyBillNo != null">applyBillNo=#{applyBillNo},</if>
<if test="stockOrderNo != null">stockOrderNo=#{stockOrderNo},</if>
<if test="emergency != null">emergency=#{emergency},</if>
<if test="arrivalTime != null">arrivalTime=#{arrivalTime},</if>
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="long">
DELETE FROM pur_plan
WHERE id = #{id}
</delete>
</mapper> </mapper>

@ -134,6 +134,9 @@ CALL Pro_Temp_ColumnWork('pur_order', 'supId', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('pur_order', 'arrivalTime', 'datetime', 1); CALL Pro_Temp_ColumnWork('pur_order', 'arrivalTime', 'datetime', 1);
CALL Pro_Temp_ColumnWork('pur_order', 'dealStatus', 'int', 1); CALL Pro_Temp_ColumnWork('pur_order', 'dealStatus', 'int', 1);
CALL Pro_Temp_ColumnWork('pur_plan', 'applyInv', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('pur_order', 'applyInv', 'varchar(255)', 1);
INSERT ignore INTO `auth_warehouse`(`id`, `code`, `name`, `parentId`, `remark`, `defaultInv`, `thirdId`, `thirdId1`, INSERT ignore INTO `auth_warehouse`(`id`, `code`, `name`, `parentId`, `remark`, `defaultInv`, `thirdId`, `thirdId1`,
`thirdId2`, `thirdId3`, `thirdId4`, `parentCode`, `advanceType`, `spUse`) `thirdId2`, `thirdId3`, `thirdId4`, `parentCode`, `advanceType`, `spUse`)
VALUES ('1541070754823692288', '1000000', '总库', '1000', '总111111', 0, '1001304', '402', NULL, NULL, NULL, '', 1, 1); VALUES ('1541070754823692288', '1000000', '总库', '1000', '总111111', 0, '1001304', '402', NULL, NULL, NULL, '', 1, 1);
@ -491,7 +494,7 @@ CALL Pro_Temp_ColumnWork('inv_place_order_detail', 'topInvCode', 'varchar(255)',
CALL Pro_Temp_ColumnWork('inv_place_order_detail', 'topInvSpaceCode', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('inv_place_order_detail', 'topInvSpaceCode', 'varchar(255)', 1);
call Modify_index('basic_products','uuid','idx_uuid','BTREE'); call Modify_index('basic_products', 'uuid', 'idx_uuid', 'BTREE');
CALL Pro_Temp_ColumnWork('basic_products', 'sfwblztlcp', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('basic_products', 'sfwblztlcp', 'varchar(255)', 1);

Loading…
Cancel
Save