请领单-购物车界面接口
【√】1、筛选树 【√】2、树的每级下的物料数量 【√】3、检索(返回的数据需要带购物车id 查请领数量、置顶标识,是否已添加购物车):名称、规格型号、拼音、物料代码+筛选里面已选择的 【√】4、进页面:查购物车列表(nuid+elderid) 【√】5、添加购物车:如果有未收货请领单,不能提 【√】6、删除购物车:单个/批量 【√】7、清空购物车:nuid+elderid 【√】8、置顶、取消置顶(取消真删除) 【√】9、物料详情:需要查购物车里的数量(nuid+elderid)+新加的护理单元日志(nuid+elderid+入库状态 总数量) 【√】10、请领记录:已入的日志+分页 【√ 共用4】11、提交前预览请领单 【√】12、提交请领单接口:生成新的请领单、单号 把购物车挪到子表 员工、库管都变未读
This commit is contained in:
parent
083635bf59
commit
a692894b73
|
|
@ -1,18 +1,13 @@
|
|||
package com.nu.modules.pad.invoicing.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.entity.InvoicingQldGwcEntity;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import com.nu.entity.MaterialCategoryEntity;
|
||||
import com.nu.entity.MaterialInfoEntity;
|
||||
import com.nu.entity.*;
|
||||
import com.nu.modules.invoicing.api.IQinglingApi;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
|
@ -74,6 +69,7 @@ public class InvoicingQldApi {
|
|||
|
||||
/**
|
||||
* 请领单-购物车信息查询
|
||||
* 需要nuid+elderid
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
|
|
@ -84,4 +80,125 @@ public class InvoicingQldApi {
|
|||
List<InvoicingQldGwcEntity> result = qinglingApi.queryGwcInfo(queryDto);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-购物车-添加
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-购物车-添加", notes = "请领单-购物车-添加")
|
||||
@PostMapping(value = "/addGwc")
|
||||
public Result<?> addGwc(@RequestBody InvoicingQldGwcEntity dto) {
|
||||
boolean result = qinglingApi.addGwc(dto);
|
||||
if (result) {
|
||||
return Result.OK("添加成功");
|
||||
} else {
|
||||
return Result.error("添加失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-购物车-移除物料
|
||||
* 传购物车表id
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-购物车-移除物料", notes = "请领单-购物车-移除物料")
|
||||
@PostMapping(value = "/deleteGwcWl")
|
||||
public Result<?> deleteGwcWl(@RequestBody InvoicingQldQueryEntity queryDto) {
|
||||
boolean result = qinglingApi.deleteGwcWl(queryDto);
|
||||
if (result) {
|
||||
return Result.OK("移除成功");
|
||||
} else {
|
||||
return Result.error("移除失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-购物车-清空
|
||||
* 传nuid+elderid
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-购物车-清空", notes = "请领单-购物车-清空")
|
||||
@PostMapping(value = "/removeAllGwc")
|
||||
public Result<?> removeAllGwc(@RequestBody InvoicingQldQueryEntity queryDto) {
|
||||
boolean result = qinglingApi.removeAllGwc(queryDto);
|
||||
if (result) {
|
||||
return Result.OK("清空成功");
|
||||
} else {
|
||||
return Result.error("清空失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-物料-置顶/取消置顶
|
||||
* 传nuid+elderid
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-物料-置顶/取消置顶", notes = "请领单物料-置顶/取消置顶")
|
||||
@PostMapping(value = "/wlzd")
|
||||
public Result<?> wlzd(@RequestBody InvoicingQldQueryEntity queryDto) {
|
||||
boolean result = qinglingApi.wlzd(queryDto);
|
||||
if (result) {
|
||||
return Result.OK("操作成功");
|
||||
} else {
|
||||
return Result.error("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料详情
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询物料详情", notes = "查询物料详情")
|
||||
@GetMapping(value = "/queryMaterialInfo")
|
||||
public Result<MaterialInfoEntity> queryMaterialInfo(InvoicingQldQueryEntity queryDto) {
|
||||
if (StringUtils.isBlank(queryDto.getNuId()) || StringUtils.isBlank(queryDto.getElderId()) || StringUtils.isBlank(queryDto.getWlId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
return Result.OK(qinglingApi.queryMaterialInfo(queryDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料请领完成记录(领取成功的)
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询物料请领完成记录(领取成功的)", notes = "查询物料请领完成记录(领取成功的)")
|
||||
@GetMapping(value = "/queryQlwcLog")
|
||||
public Result<IPage<InvoicingQldLogEntity>> queryQlwcLog(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()) || StringUtils.isBlank(queryDto.getWlId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
return Result.OK(qinglingApi.queryQlwcLog(queryDto, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-提交请领单
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-提交请领单", notes = "请领单-提交请领单")
|
||||
@PostMapping(value = "/submitQld")
|
||||
public Result<?> submitQld(@RequestBody InvoicingQldGwcEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
return Result.ok(qinglingApi.submitQld(dto));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -37,7 +38,7 @@ public class InvoicingQldGwcEntity {
|
|||
/**
|
||||
* 库房id nu_warehouse_material_info.nu_id
|
||||
*/
|
||||
private String kfIf;
|
||||
private String kfId;
|
||||
/**
|
||||
* 物料id nu_config_material_info.id
|
||||
*/
|
||||
|
|
@ -54,4 +55,10 @@ public class InvoicingQldGwcEntity {
|
|||
* 长者id nu_biz_elder_info.id
|
||||
*/
|
||||
private String elderId;
|
||||
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
private MaterialInfoEntity materialInfo;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 进销存-请领单-请领信息表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class InvoicingQldInfoEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**createBy*/
|
||||
/**createTime*/
|
||||
private Date createTime;
|
||||
/**updateBy*/
|
||||
private String updateBy;
|
||||
/**updateTime*/
|
||||
private Date updateTime;
|
||||
/**请领单单号*/
|
||||
private String qldNo;
|
||||
/**库房id nu_warehouse_material_info.nu_id*/
|
||||
private String kfId;
|
||||
/**物料id nu_config_material_info.id*/
|
||||
private String wlId;
|
||||
/**物料id nu_config_material_info.id*/
|
||||
private String materialName;
|
||||
/**请领数量*/
|
||||
private Integer qlNum;
|
||||
/**nuid nu_base_info.nu_id*/
|
||||
private String nuId;
|
||||
/**长者id nu_biz_elder_info.id*/
|
||||
private String elderId;
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 进销存-请领单-操作日志表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class InvoicingQldLogEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* createBy
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* createTime
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date createTime;
|
||||
/**
|
||||
* updateBy
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* updateTime
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 请领单单号
|
||||
*/
|
||||
private String qldNo;
|
||||
/**
|
||||
* 操作类型 0添加购物车 1作废 2回退 3提交 4出库 5收货
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
private String opeBy;
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
private Date opeTime;
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String jdMc;
|
||||
/**
|
||||
* nuid nu_base_info.nu_id
|
||||
*/
|
||||
private String nuId;
|
||||
/**
|
||||
* 长者id nu_biz_elder_info.id
|
||||
*/
|
||||
private String elderId;
|
||||
//员工姓名
|
||||
private String empName;
|
||||
//请领数量
|
||||
private Integer qlNum;
|
||||
//货品单位
|
||||
private String materialUnits;
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 进销存-请领单主表信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class InvoicingQldMainEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 请领单单号
|
||||
*/
|
||||
private String qldNo;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 员工是否已读 Y已读 N有最新未读
|
||||
*/
|
||||
private String izYgRead;
|
||||
/**
|
||||
* 库管是否已读 Y已读 N有最新未读
|
||||
*/
|
||||
private String izKgRead;
|
||||
/**
|
||||
* 提交人
|
||||
*/
|
||||
private String tjBy;
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
private Date tjTime;
|
||||
/**
|
||||
* 作废人
|
||||
*/
|
||||
private String zfBy;
|
||||
/**
|
||||
* 作废时间
|
||||
*/
|
||||
private Date zfTime;
|
||||
/**
|
||||
* 回退人
|
||||
*/
|
||||
private String htBy;
|
||||
/**
|
||||
* 回退时间
|
||||
*/
|
||||
private Date htTime;
|
||||
/**
|
||||
* 出库人
|
||||
*/
|
||||
private String ckBy;
|
||||
/**
|
||||
* 出库时间
|
||||
*/
|
||||
private Date ckTime;
|
||||
/**
|
||||
* 收货人
|
||||
*/
|
||||
private String shBy;
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
private Date shTime;
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String jdMc;
|
||||
/**
|
||||
* nuid nu_base_info.nu_id
|
||||
*/
|
||||
private String nuId;
|
||||
/**
|
||||
* 长者id nu_biz_elder_info.id
|
||||
*/
|
||||
private String elderId;
|
||||
/**
|
||||
* 作废原因
|
||||
*/
|
||||
private String zfYy;
|
||||
/**
|
||||
* 回退原因
|
||||
*/
|
||||
private String htYy;
|
||||
|
||||
/**
|
||||
* 长者入驻时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date elderRzsj;
|
||||
/**
|
||||
* 请领单购物车信息
|
||||
*/
|
||||
private List<InvoicingQldGwcEntity> qldWgcList;
|
||||
/**
|
||||
* 请领单信息
|
||||
*/
|
||||
private List<InvoicingQldInfoEntity> qldInfoList;
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.nu.entity;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 进销存-请领单-查询实体类
|
||||
*
|
||||
|
|
@ -29,4 +31,20 @@ public class InvoicingQldQueryEntity{
|
|||
* 长者id nu_biz_elder_info.id
|
||||
*/
|
||||
private String elderId;
|
||||
|
||||
/**
|
||||
* 购物车id
|
||||
*/
|
||||
private String gwcId;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private String wlId;
|
||||
|
||||
/**
|
||||
* 是否置顶
|
||||
*/
|
||||
private Boolean izZd;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,4 +129,10 @@ public class MaterialInfoEntity implements Serializable {
|
|||
private String delId;
|
||||
|
||||
private String elderId;
|
||||
private Integer wlNum;//累计入库物料数量
|
||||
private Integer qlNum;//购物车请领数量
|
||||
|
||||
private java.lang.String zhiDingId;//置顶Id
|
||||
private Date zhiDingTime;//置顶时间
|
||||
private String gwcId;//购物车ID
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.nu.modules.invoicing.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.entity.InvoicingQldGwcEntity;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import com.nu.entity.MaterialCategoryEntity;
|
||||
import com.nu.entity.MaterialInfoEntity;
|
||||
import com.nu.entity.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
|
@ -19,4 +16,18 @@ public interface IQinglingApi {
|
|||
IPage<MaterialInfoEntity> queryInvoicingList(Integer pageNo, Integer pageSize, MaterialInfoEntity materialInfoEntityDto, HttpServletRequest req);
|
||||
|
||||
List<InvoicingQldGwcEntity> queryGwcInfo(InvoicingQldQueryEntity queryDto);
|
||||
|
||||
boolean addGwc(InvoicingQldGwcEntity dto);
|
||||
|
||||
boolean deleteGwcWl(InvoicingQldQueryEntity queryDto);
|
||||
|
||||
boolean removeAllGwc(InvoicingQldQueryEntity queryDto);
|
||||
|
||||
boolean wlzd(InvoicingQldQueryEntity queryDto);
|
||||
|
||||
MaterialInfoEntity queryMaterialInfo(InvoicingQldQueryEntity queryDto);
|
||||
|
||||
IPage<InvoicingQldLogEntity> queryQlwcLog(InvoicingQldQueryEntity queryDto, Integer pageNo, Integer pageSize);
|
||||
|
||||
Map<String,Object> submitQld(InvoicingQldGwcEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,4 +194,9 @@ public class ConfigMaterialInfo implements Serializable {
|
|||
private String keyWord;
|
||||
@TableField(exist = false)
|
||||
private String suppliersName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer wlNum;//累计入库物料数量
|
||||
@TableField(exist = false)
|
||||
private Integer qlNum;//购物车请领数量
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import com.nu.entity.MaterialInfoEntity;
|
||||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialCategory;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -33,4 +34,6 @@ public interface ConfigMaterialInfoMapper extends BaseMapper<ConfigMaterialInfo>
|
|||
List<ConfigMaterialInfo> getGwcTreeDataWlnum(@Param(Constants.WRAPPER) QueryWrapper<ConfigMaterialInfo> queryWrapper);
|
||||
|
||||
List<ConfigMaterialInfo> getCgdTreeDataWlnum(@Param(Constants.WRAPPER) QueryWrapper<ConfigMaterialInfo> queryWrapper);
|
||||
|
||||
ConfigMaterialInfo queryMaterialInfo(InvoicingQldQueryEntity queryDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,4 +88,11 @@
|
|||
left join nu_config_material_info b on b.id = a.wl_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
<select id="queryMaterialInfo" resultType="com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo">
|
||||
select info.*,nukcsl.wl_num AS wlNum,gwc.ql_num AS qlNum
|
||||
from nu_config_material_info info
|
||||
left join nu_invoicing_nu_kcsl nukcsl on info.id = nukcsl.wl_id and nukcsl.nu_id = #{nuId} and nukcsl.elder_id = #{elderId}
|
||||
left join nu_invoicing_qld_gwc gwc on gwc.wl_id = info.id and gwc.nu_id = #{nuId} and gwc.elder_id = #{elderId}
|
||||
where info.id = #{wlId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1,54 +1,38 @@
|
|||
package com.nu.modules.fkd.controller;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
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.nu.modules.cgd.entity.NuInvoicingCgdMain;
|
||||
import com.nu.modules.cgd.service.INuInvoicingCgdInfoService;
|
||||
import com.nu.modules.cgd.service.INuInvoicingCgdMainService;
|
||||
import com.nu.modules.configSuppliersInfo.entity.ConfigSuppliersInfo;
|
||||
import com.nu.modules.configSuppliersInfo.service.IConfigSuppliersInfoService;
|
||||
import com.nu.modules.fkd.entity.NuInvoicingFkdInfo;
|
||||
import com.nu.modules.fkd.service.INuInvoicingFkdInfoService;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
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.util.oConvertUtils;
|
||||
import com.nu.modules.fkd.entity.NuInvoicingFkdMain;
|
||||
import com.nu.modules.fkd.service.INuInvoicingFkdInfoService;
|
||||
import com.nu.modules.fkd.service.INuInvoicingFkdMainService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 进销存-付款单主信息
|
||||
|
|
@ -109,30 +93,54 @@ public class NuInvoicingFkdMainController extends JeecgController<NuInvoicingFkd
|
|||
@RequiresPermissions("fkd:nu_invoicing_fkd_main:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuInvoicingFkdMain dto) {
|
||||
|
||||
NuInvoicingFkdMain saveData = new NuInvoicingFkdMain();
|
||||
//查询当前编码
|
||||
QueryWrapper<NuInvoicingFkdMain> qw = new QueryWrapper<>();
|
||||
qw.orderByDesc("create_time");
|
||||
List<NuInvoicingFkdMain> list = nuInvoicingFkdMainService.list(qw);
|
||||
String fkdOrder = "001";
|
||||
if (list != null && list.size() > 0) {
|
||||
int fkdNoOrder = list.get(0).getFkdNoOrder();
|
||||
fkdOrder = String.format("%03d", fkdNoOrder + 1);
|
||||
saveData.setFkdNoOrder(fkdNoOrder + 1);
|
||||
} else {
|
||||
saveData.setFkdNoOrder(1);
|
||||
|
||||
//处理付款单编号
|
||||
{
|
||||
// 查询机构编码
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String deptCode = deptInfo.getString("code");
|
||||
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
|
||||
// 构建今天的前缀模式
|
||||
String todayPrefix = "F" + deptCode + today;
|
||||
|
||||
// 查询今天所有的编号
|
||||
QueryWrapper<NuInvoicingFkdMain> qw = new QueryWrapper<>();
|
||||
qw.likeRight("fkd_no", todayPrefix);
|
||||
qw.select("fkd_no");
|
||||
|
||||
List<NuInvoicingFkdMain> list = nuInvoicingFkdMainService.list(qw);
|
||||
int maxOrderNo = 0;
|
||||
|
||||
if (list != null && !list.isEmpty()) {
|
||||
// 从qldNo中提取序号,找到最大值
|
||||
for (NuInvoicingFkdMain item : list) {
|
||||
if (item.getFkdNo() != null && item.getFkdNo().startsWith(todayPrefix)) {
|
||||
// 提取序号部分(最后几位)
|
||||
String orderStr = item.getFkdNo().substring(todayPrefix.length());
|
||||
try {
|
||||
int order = Integer.parseInt(orderStr);
|
||||
if (order > maxOrderNo) {
|
||||
maxOrderNo = order;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 如果解析失败,跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int nextOrderNo = maxOrderNo + 1;
|
||||
String qldOrder = String.format("%03d", nextOrderNo);
|
||||
saveData.setFkdNo(todayPrefix + qldOrder);
|
||||
}
|
||||
|
||||
//查询机构编码
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
|
||||
//查询供应商开户行信息
|
||||
QueryWrapper<ConfigSuppliersInfo> khhQw = new QueryWrapper<>();
|
||||
khhQw.eq("id", dto.getGysId());
|
||||
ConfigSuppliersInfo khhInfo = suppliersInfoService.getOne(khhQw);
|
||||
|
||||
//规则 F+机构编码+年月日+排序
|
||||
saveData.setFkdNo("F" + deptInfo.getString("code") + LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + fkdOrder);
|
||||
saveData.setGysId(dto.getGysId());
|
||||
saveData.setGysName(dto.getGysName());
|
||||
if (khhInfo != null) {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class NuInvoicingNuCrkLog implements Serializable {
|
|||
/**库房id nu_warehouse_material_info.nu_id*/
|
||||
@Excel(name = "库房id nu_warehouse_material_info.nu_id", width = 15)
|
||||
@ApiModelProperty(value = "库房id nu_warehouse_material_info.nu_id")
|
||||
private java.lang.String kfIf;
|
||||
private java.lang.String kfId;
|
||||
/**物料id nu_config_material_info.id*/
|
||||
@Excel(name = "物料id nu_config_material_info.id", width = 15)
|
||||
@ApiModelProperty(value = "物料id nu_config_material_info.id")
|
||||
|
|
|
|||
|
|
@ -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 com.baomidou.mybatisplus.annotation.*;
|
||||
import com.nu.entity.MaterialInfoEntity;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
|
|
@ -57,7 +56,7 @@ public class NuInvoicingQldGwc implements Serializable {
|
|||
/**库房id nu_warehouse_material_info.nu_id*/
|
||||
@Excel(name = "库房id nu_warehouse_material_info.nu_id", width = 15)
|
||||
@ApiModelProperty(value = "库房id nu_warehouse_material_info.nu_id")
|
||||
private java.lang.String kfIf;
|
||||
private java.lang.String kfId;
|
||||
/**物料id nu_config_material_info.id*/
|
||||
@Excel(name = "物料id nu_config_material_info.id", width = 15)
|
||||
@ApiModelProperty(value = "物料id nu_config_material_info.id")
|
||||
|
|
@ -74,4 +73,5 @@ public class NuInvoicingQldGwc 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;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class NuInvoicingQldInfo implements Serializable {
|
|||
/**库房id nu_warehouse_material_info.nu_id*/
|
||||
@Excel(name = "库房id nu_warehouse_material_info.nu_id", width = 15)
|
||||
@ApiModelProperty(value = "库房id nu_warehouse_material_info.nu_id")
|
||||
private java.lang.String kfIf;
|
||||
private java.lang.String kfId;
|
||||
/**物料id nu_config_material_info.id*/
|
||||
@Excel(name = "物料id nu_config_material_info.id", width = 15)
|
||||
@ApiModelProperty(value = "物料id nu_config_material_info.id")
|
||||
|
|
|
|||
|
|
@ -62,10 +62,6 @@ public class NuInvoicingQldMain implements Serializable {
|
|||
@Excel(name = "请领状态 0购物车 1已作废 2已回退 3待出库 4已出库 5已收货", width = 15)
|
||||
@ApiModelProperty(value = "请领状态 0购物车 1已作废 2已回退 3待出库 4已出库 5已收货")
|
||||
private java.lang.String status;
|
||||
/**编号*/
|
||||
@Excel(name = "编号", width = 15)
|
||||
@ApiModelProperty(value = "编号")
|
||||
private java.lang.Integer qldNoOrder;
|
||||
/**员工是否已读 Y已读 N有最新未读*/
|
||||
@Excel(name = "员工是否已读 Y已读 N有最新未读", width = 15)
|
||||
@ApiModelProperty(value = "员工是否已读 Y已读 N有最新未读")
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.nu.modules.qld.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.nu.entity.InvoicingQldGwcEntity;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldGwc;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
|
@ -14,4 +16,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface NuInvoicingQldGwcMapper extends BaseMapper<NuInvoicingQldGwc> {
|
||||
|
||||
int deletePhysics(@Param("id") String gwcId);
|
||||
|
||||
int removeAllGwc(InvoicingQldQueryEntity queryDto);
|
||||
|
||||
List<InvoicingQldGwcEntity> queryGwcInfo(InvoicingQldQueryEntity queryDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@ 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.InvoicingQldLogEntity;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
|
@ -14,4 +18,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface NuInvoicingQldLogMapper extends BaseMapper<NuInvoicingQldLog> {
|
||||
|
||||
IPage<InvoicingQldLogEntity> queryQlwcLog(Page<NuInvoicingQldLog> page,@Param("dto") InvoicingQldQueryEntity queryDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@ package com.nu.modules.qld.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.nu.entity.InvoicingQldGwcEntity;
|
||||
import com.nu.entity.InvoicingQldInfoEntity;
|
||||
import com.nu.entity.InvoicingQldMainEntity;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldMain;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
|
@ -14,4 +18,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface NuInvoicingQldMainMapper extends BaseMapper<NuInvoicingQldMain> {
|
||||
|
||||
List<InvoicingQldInfoEntity> queryUnFinishWlid(InvoicingQldGwcEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface NuInvoicingQldWlzdMapper extends BaseMapper<NuInvoicingQldWlzd> {
|
||||
|
||||
int deletePhysics(NuInvoicingQldWlzd data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,67 @@
|
|||
<!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.NuInvoicingQldGwcMapper">
|
||||
|
||||
</mapper>
|
||||
<delete id="deletePhysics">
|
||||
delete
|
||||
from nu_invoicing_qld_gwc
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<delete id="removeAllGwc">
|
||||
delete
|
||||
from nu_invoicing_qld_gwc
|
||||
where nu_id = #{nuId}
|
||||
and elder_id = #{elderId}
|
||||
</delete>
|
||||
<select id="queryGwcInfo" resultType="com.nu.entity.InvoicingQldGwcEntity">
|
||||
SELECT
|
||||
gwc.id,
|
||||
gwc.create_by,
|
||||
gwc.create_time,
|
||||
gwc.update_by,
|
||||
gwc.update_time,
|
||||
gwc.kf_id,
|
||||
gwc.wl_id,
|
||||
gwc.ql_num,
|
||||
gwc.nu_id,
|
||||
gwc.elder_id,
|
||||
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_gwc gwc
|
||||
LEFT JOIN nu_config_material_info material ON gwc.wl_id = material.id
|
||||
WHERE gwc.nu_id = #{nuId}
|
||||
AND gwc.elder_id = #{elderId}
|
||||
ORDER BY gwc.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -2,4 +2,12 @@
|
|||
<!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.NuInvoicingQldLogMapper">
|
||||
|
||||
</mapper>
|
||||
<select id="queryQlwcLog" resultType="com.nu.entity.InvoicingQldLogEntity">
|
||||
select log.*,emp.name AS empName,info.ql_num AS qlNum,minfo.material_units AS materialUnits
|
||||
from nu_invoicing_qld_log log
|
||||
left join nu_invoicing_qld_info info on log.qld_no = info.qld_no
|
||||
left join nu_biz_employees_info emp on log.ope_by = emp.id
|
||||
left join nu_config_material_info minfo on info.wl_id = minfo.id
|
||||
where log.nu_id = #{dto.nuId} and log.elder_id = #{dto.elderId} and info.wl_id = #{dto.wlId} and log.status = '5'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -2,4 +2,13 @@
|
|||
<!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.NuInvoicingQldMainMapper">
|
||||
|
||||
</mapper>
|
||||
<select id="queryUnFinishWlid" resultType="com.nu.entity.InvoicingQldInfoEntity">
|
||||
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
|
||||
where main.nu_id = #{nuId}
|
||||
and main.elder_id = #{elderId}
|
||||
and main.status in ('1', '3', '4')
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -2,4 +2,7 @@
|
|||
<!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.NuInvoicingQldWlzdMapper">
|
||||
|
||||
</mapper>
|
||||
<delete id="deletePhysics">
|
||||
delete from nu_invoicing_qld_wlzd where nu_id = #{nuId} and elder_id = #{elderId} and wl_id = #{wlId}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.qld.service;
|
||||
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldGwc;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
|
@ -11,4 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface INuInvoicingQldGwcService extends IService<NuInvoicingQldGwc> {
|
||||
|
||||
int deletePhysics(String gwcId);
|
||||
|
||||
int removeAllGwc(InvoicingQldQueryEntity queryDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.qld.service;
|
||||
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldWlzd;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
|
@ -11,4 +12,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface INuInvoicingQldWlzdService extends IService<NuInvoicingQldWlzd> {
|
||||
|
||||
boolean wlzd(InvoicingQldQueryEntity queryDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.qld.service.impl;
|
||||
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldGwc;
|
||||
import com.nu.modules.qld.mapper.NuInvoicingQldGwcMapper;
|
||||
import com.nu.modules.qld.service.INuInvoicingQldGwcService;
|
||||
|
|
@ -10,10 +11,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
/**
|
||||
* @Description: 进销存-请领单-购物车
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-26
|
||||
* @Date: 2025-11-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuInvoicingQldGwcServiceImpl extends ServiceImpl<NuInvoicingQldGwcMapper, NuInvoicingQldGwc> implements INuInvoicingQldGwcService {
|
||||
|
||||
@Override
|
||||
public int deletePhysics(String gwcId) {
|
||||
return baseMapper.deletePhysics(gwcId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeAllGwc(InvoicingQldQueryEntity queryDto) {
|
||||
return baseMapper.removeAllGwc(queryDto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.nu.modules.qld.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldWlzd;
|
||||
import com.nu.modules.qld.mapper.NuInvoicingQldWlzdMapper;
|
||||
import com.nu.modules.qld.service.INuInvoicingQldWlzdService;
|
||||
|
|
@ -10,10 +12,27 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
/**
|
||||
* @Description: 进销存-请领单-物料置顶中间表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-26
|
||||
* @Date: 2025-11-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuInvoicingQldWlzdServiceImpl extends ServiceImpl<NuInvoicingQldWlzdMapper, NuInvoicingQldWlzd> implements INuInvoicingQldWlzdService {
|
||||
|
||||
@Override
|
||||
public boolean wlzd(InvoicingQldQueryEntity queryDto) {
|
||||
if (queryDto.getIzZd() == null) {
|
||||
return false;
|
||||
}
|
||||
NuInvoicingQldWlzd data = new NuInvoicingQldWlzd();
|
||||
data.setWlId(queryDto.getWlId());
|
||||
data.setNuId(queryDto.getNuId());
|
||||
data.setElderId(queryDto.getElderId());
|
||||
if (queryDto.getIzZd()) {
|
||||
//置顶
|
||||
return baseMapper.insert(data) > 0 ? true : false;
|
||||
} else {
|
||||
//取消置顶
|
||||
return baseMapper.deletePhysics(data) > 0 ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,46 @@
|
|||
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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.entity.InvoicingQldGwcEntity;
|
||||
import com.nu.entity.InvoicingQldQueryEntity;
|
||||
import com.nu.entity.MaterialCategoryEntity;
|
||||
import com.nu.entity.MaterialInfoEntity;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nu.entity.*;
|
||||
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.elder.api.IElderInfoApi;
|
||||
import com.nu.modules.fkd.entity.NuInvoicingFkdMain;
|
||||
import com.nu.modules.invoicing.api.IQinglingApi;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldGwc;
|
||||
import com.nu.modules.qld.entity.*;
|
||||
import com.nu.modules.qld.mapper.NuInvoicingQldGwcMapper;
|
||||
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.INuInvoicingQldMainService;
|
||||
import com.nu.modules.qld.service.INuInvoicingQldWlzdService;
|
||||
import com.nu.modules.warehouseMaterialInfo.entity.BlWarehouseMaterialInfo;
|
||||
import com.nu.modules.warehouseMaterialInfo.mapper.BlWarehouseMaterialInfoMapper;
|
||||
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.util.CollectionUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 进销存-请领单-通用处理
|
||||
|
|
@ -47,6 +60,22 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
//请领单购物车
|
||||
@Autowired
|
||||
private INuInvoicingQldGwcService invoicingQldGwcService;
|
||||
@Autowired
|
||||
private INuInvoicingQldWlzdService invoicingQldWlzdService;
|
||||
@Autowired
|
||||
private NuInvoicingQldMainMapper invoicingQldMainMapper;
|
||||
@Autowired
|
||||
private NuInvoicingQldLogMapper invoicingQldLogMapper;
|
||||
@Autowired
|
||||
private IElderInfoApi elderInfoApi;
|
||||
@Autowired
|
||||
private NuInvoicingQldGwcMapper invoicingQldGwcMapper;
|
||||
@Autowired
|
||||
private INuInvoicingQldMainService invoicingQldMainService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private NuInvoicingQldInfoServiceImpl invoicingQldInfoService;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getMaterialTreeData(MaterialCategoryEntity materialCategoryEntity) {
|
||||
|
|
@ -60,12 +89,6 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
public Map<String, Object> getTreeDataWlnum(MaterialCategoryEntity configMaterialCategory) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
QueryWrapper<ConfigMaterialInfo> queryWrapper = new QueryWrapper<ConfigMaterialInfo>();
|
||||
if (StringUtils.isEmpty(configMaterialCategory.getNuId())) {
|
||||
map.put("success", false);
|
||||
map.put("message", "参数错误");
|
||||
map.put("totalSize", null);
|
||||
return map;
|
||||
}
|
||||
queryWrapper.eq("a.del_flag", "0");
|
||||
queryWrapper.eq("a.iz_enabled", "Y");
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(configMaterialCategory.getCategoryId()), "b.category_id", configMaterialCategory.getCategoryId());
|
||||
|
|
@ -86,8 +109,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
}
|
||||
BlWarehouseMaterialInfo warehouseMaterialInfo = new BlWarehouseMaterialInfo();
|
||||
BeanUtils.copyProperties(materialInfoEntityDto, warehouseMaterialInfo);
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
QueryWrapper<BlWarehouseMaterialInfo> queryWrapper = QueryGenerator.initQueryWrapper(warehouseMaterialInfo, req.getParameterMap(), customeRuleMap);
|
||||
QueryWrapper<BlWarehouseMaterialInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.apply(StringUtils.isNotBlank(warehouseMaterialInfo.getWlParamInfo()), "( material_name like '%" + warehouseMaterialInfo.getWlParamInfo() + "%' or material_no like '%" + warehouseMaterialInfo.getWlParamInfo() + "%' or pinyin like '%" + warehouseMaterialInfo.getWlParamInfo() + "%' or specification_model like '%" + warehouseMaterialInfo.getWlParamInfo() + "%' ) ");
|
||||
queryWrapper.eq(StringUtils.isNotBlank(warehouseMaterialInfo.getCategoryId()), "category_id", warehouseMaterialInfo.getCategoryId());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(warehouseMaterialInfo.getTypeId()), "type_id", warehouseMaterialInfo.getTypeId());
|
||||
|
|
@ -110,11 +132,204 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
if (StringUtils.isBlank(queryDto.getNuId()) || StringUtils.isBlank(queryDto.getElderId())) {
|
||||
return List.of();
|
||||
}
|
||||
return invoicingQldGwcMapper.queryGwcInfo(queryDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addGwc(InvoicingQldGwcEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId()) || dto.getQlNum() == null || dto.getQlNum() == 0) {
|
||||
return false;
|
||||
}
|
||||
QueryWrapper<NuInvoicingQldGwc> qw = new QueryWrapper<>();
|
||||
qw.eq("nu_id", dto.getNuId());
|
||||
qw.eq("elder_id", dto.getElderId());
|
||||
qw.eq("wl_id", dto.getWlId());
|
||||
NuInvoicingQldGwc one = invoicingQldGwcService.getOne(qw);
|
||||
if (one != null) {
|
||||
dto.setQlNum(dto.getQlNum());//前端传过来的就是最终的数量
|
||||
NuInvoicingQldGwc gwcData = new NuInvoicingQldGwc();
|
||||
BeanUtils.copyProperties(dto, gwcData);
|
||||
return invoicingQldGwcService.update(gwcData, qw);
|
||||
} else {
|
||||
NuInvoicingQldGwc gwcData = new NuInvoicingQldGwc();
|
||||
BeanUtils.copyProperties(dto, gwcData);
|
||||
return invoicingQldGwcService.save(gwcData);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteGwcWl(InvoicingQldQueryEntity queryDto) {
|
||||
if (StringUtils.isBlank(queryDto.getGwcId())) {
|
||||
return false;
|
||||
}
|
||||
return invoicingQldGwcService.deletePhysics(queryDto.getGwcId()) > 0 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAllGwc(InvoicingQldQueryEntity queryDto) {
|
||||
if (StringUtils.isBlank(queryDto.getNuId()) || StringUtils.isBlank(queryDto.getElderId())) {
|
||||
return false;
|
||||
}
|
||||
return invoicingQldGwcService.removeAllGwc(queryDto) > 0 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wlzd(InvoicingQldQueryEntity queryDto) {
|
||||
if (StringUtils.isBlank(queryDto.getNuId()) || StringUtils.isBlank(queryDto.getElderId()) || StringUtils.isBlank(queryDto.getWlId())) {
|
||||
return false;
|
||||
}
|
||||
QueryWrapper<NuInvoicingQldWlzd> qw = new QueryWrapper<NuInvoicingQldWlzd>();
|
||||
qw.eq("nu_id", queryDto.getNuId());
|
||||
qw.eq("elder_id", queryDto.getElderId());
|
||||
List<NuInvoicingQldGwc> list = invoicingQldGwcService.list(qw);
|
||||
return BeanUtil.copyToList(list, InvoicingQldGwcEntity.class);
|
||||
qw.eq("wl_id", queryDto.getWlId());
|
||||
NuInvoicingQldWlzd one = invoicingQldWlzdService.getOne(qw);
|
||||
if (!queryDto.getIzZd()) {
|
||||
//取消置顶
|
||||
return invoicingQldWlzdService.wlzd(queryDto);
|
||||
}
|
||||
//置顶如果已存在就更新create_time
|
||||
if (one == null) {
|
||||
return invoicingQldWlzdService.wlzd(queryDto);
|
||||
} else {
|
||||
one.setCreateTime(new Date());
|
||||
return invoicingQldWlzdService.updateById(one);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialInfoEntity queryMaterialInfo(InvoicingQldQueryEntity queryDto) {
|
||||
ConfigMaterialInfo configMaterialInfo = configMaterialInfoMapper.queryMaterialInfo(queryDto);
|
||||
MaterialInfoEntity result = new MaterialInfoEntity();
|
||||
BeanUtils.copyProperties(configMaterialInfo, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<InvoicingQldLogEntity> queryQlwcLog(InvoicingQldQueryEntity queryDto, Integer pageNo, Integer pageSize) {
|
||||
//长者信息
|
||||
// List<ElderInfoEntity> elderList = elderInfoApi.queryByElderIds(new String[]{queryDto.getElderId()});
|
||||
// ElderInfoEntity elder = elderList.get(0);
|
||||
// result.setElderRzsj(elder.getCreateTime());
|
||||
Page<NuInvoicingQldLog> page = new Page<>(pageNo, pageSize);
|
||||
return invoicingQldLogMapper.queryQlwcLog(page, queryDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取nuid+elderid下购物车 数据
|
||||
* 生成请领单号
|
||||
* 将购物车信息变为info信息
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> submitQld(InvoicingQldGwcEntity dto) {
|
||||
Map<String, Object> result = Maps.newHashMap();
|
||||
//当前购物车信息
|
||||
QueryWrapper<NuInvoicingQldGwc> gwcQW = new QueryWrapper<>();
|
||||
gwcQW.eq("nu_id", dto.getNuId());
|
||||
gwcQW.eq("elder_id", dto.getElderId());
|
||||
List<NuInvoicingQldGwc> gwcList = invoicingQldGwcService.list(gwcQW);
|
||||
|
||||
//检测哪些物料有未完成请领流程的
|
||||
{
|
||||
//请领流程未完成物料id
|
||||
List<InvoicingQldInfoEntity> disabledWlList = invoicingQldMainMapper.queryUnFinishWlid(dto);
|
||||
if (!CollectionUtils.isEmpty(disabledWlList)) {
|
||||
// 提取gwcList中的所有wlId
|
||||
Set<String> gwcWlIds = gwcList.stream()
|
||||
.map(NuInvoicingQldGwc::getWlId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 过滤disabledWlList,只保留在gwcList中也存在的wlId
|
||||
disabledWlList = disabledWlList.stream()
|
||||
.filter(item -> gwcWlIds.contains(item.getWlId()))
|
||||
.collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(disabledWlList)) {
|
||||
result.put("status", "exist");
|
||||
result.put("existList", disabledWlList);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//可以正常提交
|
||||
|
||||
//存储主表数据
|
||||
NuInvoicingQldMain saveData = new NuInvoicingQldMain();
|
||||
//处理请领单编号
|
||||
{
|
||||
// 查询机构编码
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String deptCode = deptInfo.getString("code");
|
||||
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
|
||||
// 构建今天的前缀模式
|
||||
String todayPrefix = "Q" + deptCode + today;
|
||||
|
||||
// 查询今天所有的编号
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.likeRight("qld_no", todayPrefix);
|
||||
qw.select("qld_no");
|
||||
|
||||
List<NuInvoicingQldMain> list = invoicingQldMainService.list(qw);
|
||||
int maxOrderNo = 0;
|
||||
|
||||
if (list != null && !list.isEmpty()) {
|
||||
// 从qldNo中提取序号,找到最大值
|
||||
for (NuInvoicingQldMain item : list) {
|
||||
if (item.getQldNo() != null && item.getQldNo().startsWith(todayPrefix)) {
|
||||
// 提取序号部分(最后几位)
|
||||
String orderStr = item.getQldNo().substring(todayPrefix.length());
|
||||
try {
|
||||
int order = Integer.parseInt(orderStr);
|
||||
if (order > maxOrderNo) {
|
||||
maxOrderNo = order;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 如果解析失败,跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int nextOrderNo = maxOrderNo + 1;
|
||||
String qldOrder = String.format("%03d", nextOrderNo);
|
||||
saveData.setQldNo(todayPrefix + qldOrder);
|
||||
}
|
||||
saveData.setStatus("1");//待出库(已提交)
|
||||
saveData.setIzYgRead("N");//员工有新消息
|
||||
saveData.setIzKgRead("N");//库管有新消息
|
||||
{
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
saveData.setTjBy(sysUser.getId());//提交人
|
||||
saveData.setTjTime(new Date());//提交时间
|
||||
}
|
||||
saveData.setJdMc("1");//节点名称
|
||||
saveData.setNuId(dto.getNuId());
|
||||
saveData.setElderId(dto.getElderId());
|
||||
invoicingQldMainService.save(saveData);
|
||||
|
||||
//子表存储
|
||||
List<NuInvoicingQldInfo> infoList = BeanUtil.copyToList(gwcList, NuInvoicingQldInfo.class);
|
||||
infoList.stream().forEach(item -> {
|
||||
item.setQldNo(saveData.getQldNo());//请领单单号
|
||||
item.setCreateBy(null);
|
||||
item.setCreateTime(null);
|
||||
item.setUpdateBy(null);
|
||||
item.setUpdateTime(null);
|
||||
});
|
||||
invoicingQldInfoService.saveBatch(infoList);
|
||||
|
||||
//清空购物车信息
|
||||
InvoicingQldQueryEntity gwcDeleteParam = new InvoicingQldQueryEntity();
|
||||
gwcDeleteParam.setNuId(dto.getNuId());
|
||||
gwcDeleteParam.setElderId(dto.getElderId());
|
||||
invoicingQldGwcService.removeAllGwc(gwcDeleteParam);
|
||||
|
||||
result.put("status", "success");
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@
|
|||
) a
|
||||
${ew.customSqlSegment}
|
||||
ORDER BY
|
||||
IF(e.id IS NULL, 0, 1) DESC,
|
||||
e.create_time DESC
|
||||
IF(a.zhiDingId IS NULL, 0, 1) DESC,
|
||||
a.zhiDingTime DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue