请领单全部接口
This commit is contained in:
parent
aa39fbe820
commit
351d27c10f
|
|
@ -200,5 +200,134 @@ public class InvoicingQldApi {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询请领单信息
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询请领单信息", notes = "查询请领单信息")
|
||||
@GetMapping(value = "/queryQld")
|
||||
public Result<IPage<InvoicingQldMainEntity>> queryQld(InvoicingQldQueryEntity queryDto,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
if (StringUtils.isBlank(queryDto.getNuId()) || StringUtils.isBlank(queryDto.getElderId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
return Result.OK(qinglingApi.queryQld(queryDto, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-请领单物料信息查询
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-请领单物料信息查询", notes = "请领单-请领单物料信息查询")
|
||||
@GetMapping(value = "/queryQldWlInfo")
|
||||
public Result<List<InvoicingQldInfoEntity>> queryQldWlInfo(InvoicingQldQueryEntity queryDto) {
|
||||
List<InvoicingQldInfoEntity> result = qinglingApi.queryQldWlInfo(queryDto);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-作废
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-作废", notes = "请领单-作废")
|
||||
@PostMapping(value = "/cancellation")
|
||||
public Result<?> cancellation(@RequestBody InvoicingQldMainEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getQldNo())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = qinglingApi.cancellation(dto);
|
||||
if (result) {
|
||||
return Result.OK("作废成功");
|
||||
} else {
|
||||
return Result.error("作废失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-单子改为已读
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-单子改为已读", notes = "请领单-单子改为已读")
|
||||
@PostMapping(value = "/transRead")
|
||||
public Result<?> transRead(@RequestBody InvoicingQldMainEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getQldNo()) || StringUtils.isBlank(dto.getStatus())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = qinglingApi.transRead(dto);
|
||||
if (result) {
|
||||
return Result.OK("操作成功");
|
||||
} else {
|
||||
return Result.error("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-确认收货
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-确认收货", notes = "请领单-确认收货")
|
||||
@PostMapping(value = "/confirmReceipt")
|
||||
public Result<?> confirmReceipt(@RequestBody InvoicingQldMainEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getQldNo()) || StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = qinglingApi.confirmReceipt(dto);
|
||||
if (result) {
|
||||
return Result.OK("收货成功");
|
||||
} else {
|
||||
return Result.error("收货失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-回退
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-回退", notes = "请领单-回退")
|
||||
@PostMapping(value = "/orderReturn")
|
||||
public Result<?> orderReturn(@RequestBody InvoicingQldMainEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getQldNo())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = qinglingApi.orderReturn(dto);
|
||||
if (result) {
|
||||
return Result.OK("回退成功");
|
||||
} else {
|
||||
return Result.error("回退失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-出库(单个/批量)
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-出库(单个/批量)", notes = "请领单-出库(单个/批量)")
|
||||
@PostMapping(value = "/outbound")
|
||||
public Result<?> outbound(@RequestBody InvoicingQldMainEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getQldNo())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = qinglingApi.outbound(dto);
|
||||
if (result) {
|
||||
return Result.OK("出库成功");
|
||||
} else {
|
||||
return Result.error("出库失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,4 +48,8 @@ public class InvoicingQldInfoEntity implements Serializable {
|
|||
private String nuId;
|
||||
/**长者id nu_biz_elder_info.id*/
|
||||
private String elderId;
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
private MaterialInfoEntity materialInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nu.entity;
|
||||
|
||||
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 com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
|
@ -83,4 +84,7 @@ public class InvoicingQldLogEntity implements Serializable {
|
|||
private Integer qlNum;
|
||||
//货品单位
|
||||
private String materialUnits;
|
||||
private String statusText;
|
||||
private String jdMcText;
|
||||
private String opeByName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
|
@ -87,6 +88,7 @@ public class InvoicingQldMainEntity implements Serializable {
|
|||
* nuid nu_base_info.nu_id
|
||||
*/
|
||||
private String nuId;
|
||||
private String nuName;
|
||||
/**
|
||||
* 长者id nu_biz_elder_info.id
|
||||
*/
|
||||
|
|
@ -114,4 +116,19 @@ public class InvoicingQldMainEntity implements Serializable {
|
|||
* 请领单信息
|
||||
*/
|
||||
private List<InvoicingQldInfoEntity> qldInfoList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String tjByName;
|
||||
@TableField(exist = false)
|
||||
private String zfByName;
|
||||
@TableField(exist = false)
|
||||
private String htByName;
|
||||
@TableField(exist = false)
|
||||
private String ckByName;
|
||||
@TableField(exist = false)
|
||||
private String shByName;
|
||||
@TableField(exist = false)
|
||||
private String statusText;
|
||||
@TableField(exist = false)
|
||||
private List<InvoicingQldLogEntity> logList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@ public class InvoicingQldQueryEntity{
|
|||
* 请领单单号
|
||||
*/
|
||||
private String qldNo;
|
||||
/**
|
||||
* 请领单状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 节点类型
|
||||
*/
|
||||
|
|
@ -47,4 +51,9 @@ public class InvoicingQldQueryEntity{
|
|||
*/
|
||||
private Boolean izZd;
|
||||
|
||||
/**
|
||||
* 是否置顶
|
||||
*/
|
||||
private String searchContent;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,4 +30,18 @@ public interface IQinglingApi {
|
|||
IPage<InvoicingQldLogEntity> queryQlwcLog(InvoicingQldQueryEntity queryDto, Integer pageNo, Integer pageSize);
|
||||
|
||||
Map<String,Object> submitQld(InvoicingQldGwcEntity dto);
|
||||
|
||||
IPage<InvoicingQldMainEntity> queryQld(InvoicingQldQueryEntity queryDto, Integer pageNo, Integer pageSize);
|
||||
|
||||
List<InvoicingQldInfoEntity> queryQldWlInfo(InvoicingQldQueryEntity queryDto);
|
||||
|
||||
boolean transRead(InvoicingQldMainEntity dto);
|
||||
|
||||
boolean cancellation(InvoicingQldMainEntity dto);
|
||||
|
||||
boolean confirmReceipt(InvoicingQldMainEntity dto);
|
||||
|
||||
boolean orderReturn(InvoicingQldMainEntity dto);
|
||||
|
||||
boolean outbound(InvoicingQldMainEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ import java.io.Serializable;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
|
|
@ -84,4 +82,13 @@ public class NuInvoicingQldLog implements Serializable {
|
|||
@Excel(name = "长者id nu_biz_elder_info.id", width = 15)
|
||||
@ApiModelProperty(value = "长者id nu_biz_elder_info.id")
|
||||
private java.lang.String elderId;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "状态文本")
|
||||
private String statusText;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "节点名称文本")
|
||||
private String jdMcText;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "操作人姓名")
|
||||
private String opeByName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@ import java.io.Serializable;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
|
|
@ -140,4 +139,22 @@ public class NuInvoicingQldMain implements Serializable {
|
|||
@Excel(name = "回退原因", width = 15)
|
||||
@ApiModelProperty(value = "回退原因")
|
||||
private java.lang.String htYy;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String nuName;
|
||||
@TableField(exist = false)
|
||||
private String tjByName;
|
||||
@TableField(exist = false)
|
||||
private String zfByName;
|
||||
@TableField(exist = false)
|
||||
private String htByName;
|
||||
@TableField(exist = false)
|
||||
private String ckByName;
|
||||
@TableField(exist = false)
|
||||
private String shByName;
|
||||
@TableField(exist = false)
|
||||
private String statusText;
|
||||
@TableField(exist = false)
|
||||
private List<NuInvoicingQldLog> logList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.nu.modules.qld.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.nu.entity.InvoicingQldInfoEntity;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
|
@ -14,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface NuInvoicingQldInfoMapper extends BaseMapper<NuInvoicingQldInfo> {
|
||||
|
||||
List<InvoicingQldInfoEntity> queryWlInfo(InvoicingQldQueryEntity queryDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,13 @@ package com.nu.modules.qld.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.entity.InvoicingQldGwcEntity;
|
||||
import com.nu.entity.InvoicingQldInfoEntity;
|
||||
import com.nu.entity.InvoicingQldMainEntity;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldLog;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldMain;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
|
@ -19,4 +22,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
public interface NuInvoicingQldMainMapper extends BaseMapper<NuInvoicingQldMain> {
|
||||
|
||||
List<InvoicingQldInfoEntity> queryUnFinishWlid(InvoicingQldGwcEntity dto);
|
||||
|
||||
IPage<NuInvoicingQldMain> page(Page<Object> page, @Param("dto") InvoicingQldQueryEntity dto);
|
||||
|
||||
List<NuInvoicingQldLog> selectLogsByQldNos(@Param("qldNos") List<String> qldNos);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,58 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.qld.mapper.NuInvoicingQldInfoMapper">
|
||||
|
||||
<select id="queryWlInfo" resultType="com.nu.entity.InvoicingQldInfoEntity">
|
||||
SELECT
|
||||
info.wl_id,
|
||||
MAX(info.create_time) AS create_time,
|
||||
SUM(info.ql_num) AS ql_num,
|
||||
material.id AS "materialInfo.id",
|
||||
material.category_id AS "materialInfo.categoryId",
|
||||
material.type_id AS "materialInfo.typeId",
|
||||
material.medication_id AS "materialInfo.medicationId",
|
||||
material.material_name AS "materialInfo.materialName",
|
||||
material.material_no AS "materialInfo.materialNo",
|
||||
material.specification_model AS "materialInfo.specificationModel",
|
||||
material.sales_unit_price AS "materialInfo.salesUnitPrice",
|
||||
material.reference_unit_price AS "materialInfo.referenceUnitPrice",
|
||||
material.material_units AS "materialInfo.materialUnits",
|
||||
material.multi_unit_switch AS "materialInfo.multiUnitSwitch",
|
||||
material.one_unit AS "materialInfo.oneUnit",
|
||||
material.one_unit_proportion AS "materialInfo.oneUnitProportion",
|
||||
material.one_unit_price AS "materialInfo.oneUnitPrice",
|
||||
material.two_unit AS "materialInfo.twoUnit",
|
||||
material.two_unit_proportion AS "materialInfo.twoUnitProportion",
|
||||
material.two_unit_price AS "materialInfo.twoUnitPrice",
|
||||
material.multi_unit_type AS "materialInfo.multiUnitType",
|
||||
material.suppliers AS "materialInfo.suppliers",
|
||||
material.material_img AS "materialInfo.materialImg",
|
||||
material.material_ident AS "materialInfo.materialIdent",
|
||||
material.iz_enabled AS "materialInfo.izEnabled",
|
||||
material.del_flag AS "materialInfo.delFlag",
|
||||
material.create_by AS "materialInfo.createBy",
|
||||
material.create_time AS "materialInfo.createTime",
|
||||
material.update_by AS "materialInfo.updateBy",
|
||||
material.update_time AS "materialInfo.updateTime",
|
||||
material.sys_org_code AS "materialInfo.sysOrgCode",
|
||||
material.pinyin AS "materialInfo.pinyin",
|
||||
material.upper_limit AS "materialInfo.upperLimit",
|
||||
material.lower_limit AS "materialInfo.lowerLimit",
|
||||
material.tag_type AS "materialInfo.tagType",
|
||||
material.iz_ybbx AS "materialInfo.izYbbx",
|
||||
material.iz_jgyh AS "materialInfo.izJgyh"
|
||||
FROM
|
||||
nu_invoicing_qld_info info
|
||||
LEFT JOIN
|
||||
nu_config_material_info material ON info.wl_id = material.id
|
||||
WHERE
|
||||
info.qld_no IN
|
||||
<foreach collection="qldNo.split(',')" item="no" open="(" close=")" separator=",">
|
||||
#{no}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
info.wl_id,
|
||||
material.id
|
||||
ORDER BY
|
||||
MAX(info.create_time) DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<mapper namespace="com.nu.modules.qld.mapper.NuInvoicingQldMainMapper">
|
||||
|
||||
<select id="queryUnFinishWlid" resultType="com.nu.entity.InvoicingQldInfoEntity">
|
||||
select distinct info.wl_id,minfo.material_name
|
||||
select distinct info.wl_id, minfo.material_name
|
||||
from nu_invoicing_qld_main main
|
||||
left join nu_invoicing_qld_info info on main.qld_no = info.qld_no
|
||||
left join nu_config_material_info minfo on info.wl_id = minfo.id
|
||||
|
|
@ -11,4 +11,56 @@
|
|||
and main.elder_id = #{elderId}
|
||||
and main.status in ('1', '3', '4')
|
||||
</select>
|
||||
|
||||
<select id="page" resultType="com.nu.modules.qld.entity.NuInvoicingQldMain">
|
||||
SELECT
|
||||
main.*,
|
||||
baseInfo.nu_name AS nuName,
|
||||
tjEmp.name AS tjByName,
|
||||
zfEmp.name AS zfByName,
|
||||
htEmp.name AS htByName,
|
||||
ckEmp.name AS ckByName,
|
||||
shEmp.name AS shByName,
|
||||
mainStatus.item_text AS statusText
|
||||
FROM nu_invoicing_qld_main main
|
||||
LEFT JOIN nu_base_info baseInfo ON main.nu_id = baseInfo.nu_id
|
||||
LEFT JOIN nu_biz_employees_info tjEmp ON main.tj_by = tjEmp.id
|
||||
LEFT JOIN nu_biz_employees_info zfEmp ON main.zf_by = zfEmp.id
|
||||
LEFT JOIN nu_biz_employees_info htEmp ON main.ht_by = htEmp.id
|
||||
LEFT JOIN nu_biz_employees_info ckEmp ON main.ck_by = ckEmp.id
|
||||
LEFT JOIN nu_biz_employees_info shEmp ON main.sh_by = shEmp.id
|
||||
LEFT JOIN sys_dict dict ON dict.dict_code = 'qld_status'
|
||||
LEFT JOIN sys_dict_item mainStatus ON mainStatus.dict_id = dict.id AND mainStatus.item_value = main.status
|
||||
<where>
|
||||
<if test="dto.searchContent != null and dto.searchContent != ''">
|
||||
AND (main.qld_no LIKE CONCAT('%', #{dto.searchContent}, '%') or tjEmp.name LIKE CONCAT('%', #{dto.searchContent}, '%') )
|
||||
</if>
|
||||
<if test="dto.status != null and dto.status != ''">
|
||||
AND main.status = #{dto.status}
|
||||
</if>
|
||||
<if test="dto.nuId != null and dto.nuId != ''">
|
||||
AND main.nu_id = #{dto.nuId}
|
||||
</if>
|
||||
<if test="dto.elderId != null and dto.elderId != ''">
|
||||
AND main.elder_id = #{dto.elderId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY main.update_time DESC, main.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectLogsByQldNos" resultType="com.nu.modules.qld.entity.NuInvoicingQldLog">
|
||||
SELECT
|
||||
log.*,
|
||||
emp.name AS opeByName,
|
||||
logStatus.item_text AS statusText
|
||||
FROM nu_invoicing_qld_log log
|
||||
LEFT JOIN nu_biz_employees_info emp ON log.ope_by = emp.id
|
||||
LEFT JOIN sys_dict dict ON dict.dict_code = 'qld_status'
|
||||
LEFT JOIN sys_dict_item logStatus ON logStatus.dict_id = dict.id AND logStatus.item_value = log.status
|
||||
WHERE log.qld_no IN
|
||||
<foreach collection="qldNos" item="qldNo" open="(" separator="," close=")">
|
||||
#{qldNo}
|
||||
</foreach>
|
||||
ORDER BY log.create_time asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.nu.modules.qld.service.impl;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Maps;
|
||||
|
|
@ -11,29 +12,35 @@ import com.nu.modules.ConfigMaterial.entity.ConfigMaterialCategory;
|
|||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo;
|
||||
import com.nu.modules.ConfigMaterial.mapper.ConfigMaterialInfoMapper;
|
||||
import com.nu.modules.ConfigMaterial.service.IConfigMaterialCategoryService;
|
||||
import com.nu.modules.configSuppliersInfo.entity.ConfigSuppliersInfo;
|
||||
import com.nu.modules.cgd.entity.NuWarehouseMaterialCrkInfo;
|
||||
import com.nu.modules.cgd.service.INuWarehouseMaterialCrkInfoService;
|
||||
import com.nu.modules.elder.api.IElderInfoApi;
|
||||
import com.nu.modules.fkd.entity.NuInvoicingFkdMain;
|
||||
import com.nu.modules.invoicing.api.IQinglingApi;
|
||||
import com.nu.modules.nu.entity.NuInvoicingNuCrkLog;
|
||||
import com.nu.modules.nu.entity.NuInvoicingNuKcsl;
|
||||
import com.nu.modules.nu.service.INuInvoicingNuCrkLogService;
|
||||
import com.nu.modules.nu.service.INuInvoicingNuKcslService;
|
||||
import com.nu.modules.qld.entity.*;
|
||||
import com.nu.modules.qld.mapper.NuInvoicingQldGwcMapper;
|
||||
import com.nu.modules.qld.mapper.NuInvoicingQldInfoMapper;
|
||||
import com.nu.modules.qld.mapper.NuInvoicingQldLogMapper;
|
||||
import com.nu.modules.qld.mapper.NuInvoicingQldMainMapper;
|
||||
import com.nu.modules.qld.service.INuInvoicingQldGwcService;
|
||||
import com.nu.modules.qld.service.INuInvoicingQldLogService;
|
||||
import com.nu.modules.qld.service.INuInvoicingQldMainService;
|
||||
import com.nu.modules.qld.service.INuInvoicingQldWlzdService;
|
||||
import com.nu.modules.warehouseMaterialInfo.entity.BlWarehouseMaterialInfo;
|
||||
import com.nu.modules.warehouseMaterialInfo.mapper.BlWarehouseMaterialInfoMapper;
|
||||
import com.nu.modules.warehouseMaterialInfo.service.IBlWarehouseMaterialInfoService;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
|
@ -67,6 +74,8 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
@Autowired
|
||||
private NuInvoicingQldLogMapper invoicingQldLogMapper;
|
||||
@Autowired
|
||||
private INuInvoicingQldLogService invoicingQldLogService;
|
||||
@Autowired
|
||||
private IElderInfoApi elderInfoApi;
|
||||
@Autowired
|
||||
private NuInvoicingQldGwcMapper invoicingQldGwcMapper;
|
||||
|
|
@ -76,6 +85,16 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private NuInvoicingQldInfoServiceImpl invoicingQldInfoService;
|
||||
@Autowired
|
||||
private NuInvoicingQldInfoMapper invoicingQldInfoMapper;
|
||||
@Autowired
|
||||
private INuInvoicingNuCrkLogService invoicingNuCrkLogService;
|
||||
@Autowired
|
||||
private INuInvoicingNuKcslService invoicingNuKcslService;
|
||||
@Autowired
|
||||
private IBlWarehouseMaterialInfoService warehouseMaterialInfoService;
|
||||
@Autowired
|
||||
private INuWarehouseMaterialCrkInfoService warehouseMaterialCrkInfoService;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getMaterialTreeData(MaterialCategoryEntity materialCategoryEntity) {
|
||||
|
|
@ -223,6 +242,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> submitQld(InvoicingQldGwcEntity dto) {
|
||||
Map<String, Object> result = Maps.newHashMap();
|
||||
//当前购物车信息
|
||||
|
|
@ -254,6 +274,8 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
}
|
||||
|
||||
//可以正常提交
|
||||
String status = "1";//待出库(已提交)
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//存储主表数据
|
||||
NuInvoicingQldMain saveData = new NuInvoicingQldMain();
|
||||
|
|
@ -297,15 +319,12 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
String qldOrder = String.format("%03d", nextOrderNo);
|
||||
saveData.setQldNo(todayPrefix + qldOrder);
|
||||
}
|
||||
saveData.setStatus("1");//待出库(已提交)
|
||||
saveData.setStatus(status);
|
||||
saveData.setIzYgRead("N");//员工有新消息
|
||||
saveData.setIzKgRead("N");//库管有新消息
|
||||
{
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
saveData.setTjBy(sysUser.getId());//提交人
|
||||
saveData.setTjTime(new Date());//提交时间
|
||||
}
|
||||
saveData.setJdMc("1");//节点名称
|
||||
saveData.setJdMc(status);//节点名称
|
||||
saveData.setNuId(dto.getNuId());
|
||||
saveData.setElderId(dto.getElderId());
|
||||
invoicingQldMainService.save(saveData);
|
||||
|
|
@ -327,9 +346,403 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
gwcDeleteParam.setElderId(dto.getElderId());
|
||||
invoicingQldGwcService.removeAllGwc(gwcDeleteParam);
|
||||
|
||||
//日志表插记录
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(saveData.getQldNo());//请领单号
|
||||
logData.setStatus(status);//单子操作状态
|
||||
logData.setJdMc(status);//节点mc(字典qld_status)
|
||||
logData.setOpeBy(sysUser.getId());//操作人
|
||||
logData.setOpeTime(new Date());//操作时间
|
||||
logData.setNuId(dto.getNuId());//护理单元id
|
||||
logData.setElderId(dto.getElderId());//长者id
|
||||
invoicingQldLogMapper.insert(logData);
|
||||
|
||||
result.put("status", "success");
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<InvoicingQldMainEntity> queryQld(InvoicingQldQueryEntity queryDto, Integer pageNo, Integer pageSize) {
|
||||
Page<Object> page = new Page<>(pageNo, pageSize);
|
||||
|
||||
// 查询主表数据
|
||||
IPage<NuInvoicingQldMain> mainPage = invoicingQldMainMapper.page(page, queryDto);
|
||||
|
||||
// 转换为目标实体类型
|
||||
IPage<InvoicingQldMainEntity> resultPage = new Page<>(pageNo, pageSize, mainPage.getTotal());
|
||||
|
||||
if (mainPage != null && !mainPage.getRecords().isEmpty()) {
|
||||
// 获取所有请领单号
|
||||
List<String> qldNos = mainPage.getRecords().stream()
|
||||
.map(NuInvoicingQldMain::getQldNo)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 批量查询操作日志
|
||||
List<NuInvoicingQldLog> allLogs = new ArrayList<>();
|
||||
if (!qldNos.isEmpty()) {
|
||||
allLogs = invoicingQldMainMapper.selectLogsByQldNos(qldNos);
|
||||
}
|
||||
|
||||
// 按请领单号分组日志
|
||||
Map<String, List<NuInvoicingQldLog>> logMap = allLogs.stream()
|
||||
.collect(Collectors.groupingBy(NuInvoicingQldLog::getQldNo));
|
||||
|
||||
// 转换主记录
|
||||
List<InvoicingQldMainEntity> entityList = new ArrayList<>();
|
||||
for (NuInvoicingQldMain main : mainPage.getRecords()) {
|
||||
InvoicingQldMainEntity entity = new InvoicingQldMainEntity();
|
||||
BeanUtils.copyProperties(main, entity);
|
||||
|
||||
// 处理日志列表
|
||||
List<NuInvoicingQldLog> logs = logMap.get(main.getQldNo());
|
||||
if (logs != null && !logs.isEmpty()) {
|
||||
List<InvoicingQldLogEntity> logEntities = new ArrayList<>();
|
||||
|
||||
// 处理日志过滤规则
|
||||
if (logs.size() <= 3) {
|
||||
// 小于等于3条,全部保留
|
||||
for (NuInvoicingQldLog log : logs) {
|
||||
InvoicingQldLogEntity logEntity = new InvoicingQldLogEntity();
|
||||
BeanUtils.copyProperties(log, logEntity);
|
||||
logEntities.add(logEntity);
|
||||
}
|
||||
} else {
|
||||
// 大于3条,只保留前三条
|
||||
int startIndex = logs.size() - 3; // 从倒数第三条开始
|
||||
for (int i = startIndex; i < logs.size(); i++) {
|
||||
InvoicingQldLogEntity logEntity = new InvoicingQldLogEntity();
|
||||
BeanUtils.copyProperties(logs.get(i), logEntity);
|
||||
logEntities.add(logEntity);
|
||||
}
|
||||
}
|
||||
|
||||
// if (logs.size() == 1) {
|
||||
// // 只有一条数据,直接添加
|
||||
// InvoicingQldLogEntity logEntity = new InvoicingQldLogEntity();
|
||||
// BeanUtils.copyProperties(logs.get(0), logEntity);
|
||||
// logEntities.add(logEntity);
|
||||
// } else {
|
||||
// // 多条数据,根据规则处理
|
||||
// NuInvoicingQldLog firstLog = logs.get(0); // 第一条(最新的)
|
||||
// NuInvoicingQldLog lastLog = logs.get(logs.size() - 1); // 最后一条(最老的)
|
||||
//
|
||||
// // 检查第一条记录的status是否为5
|
||||
// if ("5".equals(firstLog.getStatus())) {
|
||||
// // status为5,保留第一、第二、最后一条
|
||||
// InvoicingQldLogEntity firstEntity = new InvoicingQldLogEntity();
|
||||
// BeanUtils.copyProperties(firstLog, firstEntity);
|
||||
// logEntities.add(firstEntity);
|
||||
//
|
||||
// if (logs.size() > 1) {
|
||||
// InvoicingQldLogEntity secondEntity = new InvoicingQldLogEntity();
|
||||
// BeanUtils.copyProperties(logs.get(1), secondEntity);
|
||||
// logEntities.add(secondEntity);
|
||||
// }
|
||||
//
|
||||
// InvoicingQldLogEntity lastEntity = new InvoicingQldLogEntity();
|
||||
// BeanUtils.copyProperties(lastLog, lastEntity);
|
||||
// logEntities.add(lastEntity);
|
||||
// } else {
|
||||
// // status不为5,只保留第一条和最后一条
|
||||
// InvoicingQldLogEntity firstEntity = new InvoicingQldLogEntity();
|
||||
// BeanUtils.copyProperties(firstLog, firstEntity);
|
||||
// logEntities.add(firstEntity);
|
||||
//
|
||||
// InvoicingQldLogEntity lastEntity = new InvoicingQldLogEntity();
|
||||
// BeanUtils.copyProperties(lastLog, lastEntity);
|
||||
// logEntities.add(lastEntity);
|
||||
// }
|
||||
//
|
||||
// // 去重处理(避免第一条和最后一条是同一记录)
|
||||
// logEntities = logEntities.stream()
|
||||
// .distinct()
|
||||
// .collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
entity.setLogList(logEntities);
|
||||
} else {
|
||||
entity.setLogList(new ArrayList<>());
|
||||
}
|
||||
|
||||
entityList.add(entity);
|
||||
}
|
||||
|
||||
resultPage.setRecords(entityList);
|
||||
} else {
|
||||
resultPage.setRecords(new ArrayList<>());
|
||||
}
|
||||
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InvoicingQldInfoEntity> queryQldWlInfo(InvoicingQldQueryEntity queryDto) {
|
||||
if (StringUtils.isBlank(queryDto.getQldNo())) {
|
||||
return List.of();
|
||||
}
|
||||
return invoicingQldInfoMapper.queryWlInfo(queryDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cancellation(InvoicingQldMainEntity dto) {
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.eq("qld_no", dto.getQldNo());
|
||||
NuInvoicingQldMain one = invoicingQldMainService.getOne(qw);
|
||||
if (one == null || !"1".equals(one.getStatus())) {
|
||||
return false;
|
||||
}
|
||||
dto.setNuId(one.getNuId());
|
||||
dto.setElderId(one.getElderId());
|
||||
String status = "2";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//日志表插记录
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(dto.getQldNo());//请领单号
|
||||
logData.setStatus(status);//单子操作状态
|
||||
logData.setJdMc(status);//节点mc(字典qld_status)
|
||||
logData.setOpeBy(sysUser.getId());//操作人
|
||||
logData.setOpeTime(new Date());//操作时间
|
||||
logData.setNuId(dto.getNuId());//护理单元id
|
||||
logData.setElderId(dto.getElderId());//长者id
|
||||
invoicingQldLogMapper.insert(logData);
|
||||
|
||||
//更新单子为作废
|
||||
one.setStatus(status);
|
||||
one.setIzKgRead("N");//库管改为未读
|
||||
return invoicingQldMainService.updateById(one);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean transRead(InvoicingQldMainEntity dto) {
|
||||
UpdateWrapper<NuInvoicingQldMain> uw = new UpdateWrapper<>();
|
||||
uw.eq("qld_no", dto.getQldNo());
|
||||
NuInvoicingQldMain data = new NuInvoicingQldMain();
|
||||
if ("yg".equals(dto.getStatus())) {
|
||||
data.setIzYgRead("Y");
|
||||
} else {
|
||||
data.setIzKgRead("Y");
|
||||
}
|
||||
return invoicingQldMainService.update(data, uw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认收货
|
||||
* 1、主表改为确认收货状态
|
||||
* 2、请领单操作日志表增加操作记录
|
||||
* 3、护理单元出入库日志
|
||||
* 4、护理单元货品修改对应现有数量
|
||||
* 5、添加仓库出库记录 先找出对应物料的仓库库存即为操作前库存量 请领单对应物料数即为出入库数量 两个相减即为当前库存量 crk_type 2 crk_status 3
|
||||
* 6、修改仓库库存数量 当前的值 - 操作数量
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean confirmReceipt(InvoicingQldMainEntity dto) {
|
||||
// Map<String, Object> result = Maps.newHashMap();
|
||||
String status = "5";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//主表改为已收货
|
||||
UpdateWrapper<NuInvoicingQldMain> mainUW = new UpdateWrapper<>();
|
||||
mainUW.eq("qld_no", dto.getQldNo());
|
||||
NuInvoicingQldMain mainData = new NuInvoicingQldMain();
|
||||
mainData.setStatus(status);
|
||||
invoicingQldMainService.update(mainData, mainUW);
|
||||
|
||||
//请领单操作日志表增加操作记录
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(dto.getQldNo());//请领单号
|
||||
logData.setStatus(status);//单子操作状态
|
||||
logData.setJdMc(status);//节点mc(字典qld_status)
|
||||
logData.setOpeBy(sysUser.getId());//操作人
|
||||
logData.setOpeTime(new Date());//操作时间
|
||||
logData.setNuId(dto.getNuId());//护理单元id
|
||||
logData.setElderId(dto.getElderId());//长者id
|
||||
invoicingQldLogMapper.insert(logData);
|
||||
|
||||
//护理单元出入库日志
|
||||
QueryWrapper<NuInvoicingQldInfo> qldInfoQW = new QueryWrapper<>();
|
||||
qldInfoQW.eq("qld_no", dto.getQldNo());
|
||||
List<NuInvoicingQldInfo> qldInfoList = invoicingQldInfoService.list(qldInfoQW);
|
||||
List<NuInvoicingNuCrkLog> nuCrkLogList = Lists.newArrayList();
|
||||
qldInfoList.stream().forEach(item -> {
|
||||
NuInvoicingNuCrkLog nuInvoicingNuCrkLog = new NuInvoicingNuCrkLog();
|
||||
BeanUtils.copyProperties(item, nuInvoicingNuCrkLog);
|
||||
nuInvoicingNuCrkLog.setCreateBy(null);
|
||||
nuInvoicingNuCrkLog.setCreateTime(null);
|
||||
nuInvoicingNuCrkLog.setWlNum(item.getQlNum());
|
||||
nuInvoicingNuCrkLog.setType("1");//类型 1请领
|
||||
nuInvoicingNuCrkLog.setOrderNumber(item.getQldNo());//单号
|
||||
nuInvoicingNuCrkLog.setOrderType("qld");//单子类型: qld请领单
|
||||
nuCrkLogList.add(nuInvoicingNuCrkLog);
|
||||
});
|
||||
invoicingNuCrkLogService.saveBatch(nuCrkLogList);
|
||||
|
||||
//护理单元货品修改对应现有数量 没有对应物料插入数据 有的话增加
|
||||
QueryWrapper<NuInvoicingNuKcsl> nuKcslQW = new QueryWrapper<>();
|
||||
nuKcslQW.eq("nu_id", dto.getNuId());
|
||||
nuKcslQW.eq("elder_id", dto.getElderId());
|
||||
List<NuInvoicingNuKcsl> nuKcslList = invoicingNuKcslService.list(nuKcslQW);
|
||||
//nu库存-待新增
|
||||
List<NuInvoicingNuKcsl> needAddList = Lists.newArrayList();
|
||||
//nu库存-待修改
|
||||
List<NuInvoicingNuKcsl> needUpdateList = Lists.newArrayList();
|
||||
if (!CollectionUtils.isEmpty(nuKcslList)) {
|
||||
Map<String, NuInvoicingNuKcsl> nuKcslMap = nuKcslList.stream()
|
||||
.collect(Collectors.toMap(NuInvoicingNuKcsl::getWlId, kcsl -> kcsl));
|
||||
qldInfoList.stream().forEach(item -> {
|
||||
NuInvoicingNuKcsl nuInvoicingNuKcsl = new NuInvoicingNuKcsl();
|
||||
nuInvoicingNuKcsl.setNuId(item.getNuId());
|
||||
nuInvoicingNuKcsl.setElderId(item.getElderId());
|
||||
nuInvoicingNuKcsl.setWlId(item.getWlId());
|
||||
|
||||
if (nuKcslMap.containsKey(item.getWlId())) {
|
||||
// 如果已有对应物料
|
||||
NuInvoicingNuKcsl existingKcsl = nuKcslMap.get(item.getWlId());
|
||||
nuInvoicingNuKcsl.setWlNum(item.getQlNum() + existingKcsl.getWlNum());
|
||||
needUpdateList.add(nuInvoicingNuKcsl);
|
||||
} else {
|
||||
// 如果没有对应物料
|
||||
nuInvoicingNuKcsl.setWlNum(item.getQlNum());
|
||||
needAddList.add(nuInvoicingNuKcsl);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
qldInfoList.stream().forEach(item -> {
|
||||
NuInvoicingNuKcsl nuInvoicingNuKcsl = new NuInvoicingNuKcsl();
|
||||
nuInvoicingNuKcsl.setNuId(item.getNuId());
|
||||
nuInvoicingNuKcsl.setElderId(item.getElderId());
|
||||
nuInvoicingNuKcsl.setWlId(item.getWlId());
|
||||
nuInvoicingNuKcsl.setWlNum(item.getQlNum());
|
||||
needAddList.add(nuInvoicingNuKcsl);
|
||||
});
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(needAddList)) {
|
||||
invoicingNuKcslService.saveBatch(needAddList);
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(needUpdateList)) {
|
||||
needUpdateList.stream().forEach(item -> {
|
||||
UpdateWrapper<NuInvoicingNuKcsl> nuKcslUW = new UpdateWrapper<>();
|
||||
nuKcslUW.eq("nu_id", item.getNuId());
|
||||
nuKcslUW.eq("elder_id", item.getElderId());
|
||||
nuKcslUW.eq("wl_id", item.getWlId());
|
||||
invoicingNuKcslService.update(item, nuKcslUW);
|
||||
});
|
||||
}
|
||||
|
||||
//添加仓库出库记录 先找出对应物料的仓库库存即为操作前库存量 请领单对应物料数即为出入库数量 两个相减即为当前库存量 crk_type 2 crk_status 3
|
||||
//库房物料数量
|
||||
List<BlWarehouseMaterialInfo> kfnumList = warehouseMaterialInfoService.list();
|
||||
Map<String, Map<String, String>> kfWlSlMap = kfnumList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
BlWarehouseMaterialInfo::getNuId,
|
||||
Collectors.toMap(
|
||||
BlWarehouseMaterialInfo::getWlId,
|
||||
BlWarehouseMaterialInfo::getKcsl
|
||||
)
|
||||
));
|
||||
List<NuWarehouseMaterialCrkInfo> kfCrkLogList = Lists.newArrayList();
|
||||
qldInfoList.stream().forEach(item -> {
|
||||
NuWarehouseMaterialCrkInfo kfCrkLog = new NuWarehouseMaterialCrkInfo();
|
||||
BeanUtils.copyProperties(item, kfCrkLog);
|
||||
kfCrkLog.setCreateBy(null);
|
||||
kfCrkLog.setCreateTime(null);
|
||||
kfCrkLog.setUpdateBy(null);
|
||||
kfCrkLog.setUpdateTime(null);
|
||||
kfCrkLog.setCgdId(dto.getQldNo());//请领单号
|
||||
kfCrkLog.setNuId(item.getKfId());//库房id 不是nuid
|
||||
kfCrkLog.setWlId(item.getWlId());//物料id
|
||||
kfCrkLog.setCrkNum(item.getQlNum());//出入库数量
|
||||
kfCrkLog.setCrkType("2");//出入库类型 2请领
|
||||
kfCrkLog.setCzqkcl(kfWlSlMap.get(item.getKfId()).get(item.getWlId()));//操作前库存量
|
||||
kfCrkLog.setDqkcl((Integer.parseInt(kfWlSlMap.get(item.getKfId()).get(item.getWlId())) - item.getQlNum()) + "");//当前库存量
|
||||
kfCrkLog.setCrkStatus("3");//出入库状态 3出库
|
||||
kfCrkLogList.add(kfCrkLog);
|
||||
});
|
||||
warehouseMaterialCrkInfoService.saveBatch(kfCrkLogList);
|
||||
|
||||
//修改仓库库存数量 当前的值 - 操作数量
|
||||
Map<String, Integer> qldWlNumMap = qldInfoList.stream()
|
||||
.collect(Collectors.toMap(NuInvoicingQldInfo::getWlId, NuInvoicingQldInfo::getQlNum));
|
||||
List<BlWarehouseMaterialInfo> kfUpdateList = Lists.newArrayList();
|
||||
kfnumList.stream().forEach(item -> {
|
||||
if (qldWlNumMap.get(item.getWlId()) != null) {
|
||||
item.setKcsl((Integer.parseInt(item.getKcsl()) - qldWlNumMap.get(item.getWlId())) + "");
|
||||
kfUpdateList.add(item);
|
||||
}
|
||||
});
|
||||
warehouseMaterialInfoService.updateBatchById(kfUpdateList);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean orderReturn(InvoicingQldMainEntity dto) {
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.eq("qld_no", dto.getQldNo());
|
||||
NuInvoicingQldMain one = invoicingQldMainService.getOne(qw);
|
||||
if (one == null || "2".equals(one.getStatus()) || "3".equals(one.getStatus()) || "5".equals(one.getStatus())) {
|
||||
return false;
|
||||
}
|
||||
dto.setNuId(one.getNuId());
|
||||
dto.setElderId(one.getElderId());
|
||||
String status = "3";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//日志表插记录
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(dto.getQldNo());//请领单号
|
||||
logData.setStatus(status);//单子操作状态
|
||||
logData.setJdMc(status);//节点mc(字典qld_status)
|
||||
logData.setOpeBy(sysUser.getId());//操作人
|
||||
logData.setOpeTime(new Date());//操作时间
|
||||
logData.setNuId(dto.getNuId());//护理单元id
|
||||
logData.setElderId(dto.getElderId());//长者id
|
||||
invoicingQldLogMapper.insert(logData);
|
||||
|
||||
//更新单子为作废
|
||||
one.setStatus(status);
|
||||
one.setIzYgRead("N");//员工改为未读
|
||||
return invoicingQldMainService.updateById(one);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outbound(InvoicingQldMainEntity dto) {
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.in("qld_no", dto.getQldNo().split(","));
|
||||
List<NuInvoicingQldMain> list = invoicingQldMainService.list(qw);
|
||||
NuInvoicingQldMain one = list.get(0);
|
||||
dto.setNuId(one.getNuId());
|
||||
dto.setElderId(one.getElderId());
|
||||
String status = "4";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//日志表插记录
|
||||
String[] qldNoArr = dto.getQldNo().split(",");
|
||||
int length = dto.getQldNo().split(",").length;
|
||||
List<NuInvoicingQldLog> logList = Lists.newArrayList();
|
||||
for (int i = 0; i < length; i++) {
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(qldNoArr[i]);//请领单号
|
||||
logData.setStatus(status);//单子操作状态
|
||||
logData.setJdMc(status);//节点mc(字典qld_status)
|
||||
logData.setOpeBy(sysUser.getId());//操作人
|
||||
logData.setOpeTime(new Date());//操作时间
|
||||
logData.setNuId(dto.getNuId());//护理单元id
|
||||
logData.setElderId(dto.getElderId());//长者id
|
||||
logList.add(logData);
|
||||
}
|
||||
invoicingQldLogService.saveBatch(logList);
|
||||
|
||||
//更新单子为作废
|
||||
NuInvoicingQldMain qldData = new NuInvoicingQldMain();
|
||||
qldData.setStatus(status);
|
||||
qldData.setIzYgRead("N");//员工改为未读
|
||||
return invoicingQldMainService.update(qldData, qw);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue