parent
55d05c3a38
commit
6fb0040115
|
|
@ -50,13 +50,34 @@ public class InvoicingThdApi {
|
||||||
@ApiOperation(value = "查询退货单-可退货物料", notes = "查询退货单-可退货物料")
|
@ApiOperation(value = "查询退货单-可退货物料", notes = "查询退货单-可退货物料")
|
||||||
@GetMapping(value = "/thdNuMaterialList")
|
@GetMapping(value = "/thdNuMaterialList")
|
||||||
public Result<List<NuKcslEntity>> thdNuMaterialList(InvoicingThdMainEntity dto) {
|
public Result<List<NuKcslEntity>> thdNuMaterialList(InvoicingThdMainEntity dto) {
|
||||||
if (StringUtils.isBlank(dto.getNuId())) {
|
if (StringUtils.isBlank(dto.getId()) || StringUtils.isBlank(dto.getNuId())) {
|
||||||
return Result.error("缺少参数");
|
return Result.error("缺少参数");
|
||||||
}
|
}
|
||||||
List<NuKcslEntity> pageList = tuiHuoApi.thdNuMaterialList(dto);
|
List<NuKcslEntity> pageList = tuiHuoApi.thdNuMaterialList(dto);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退货单-开始服务
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "退货单-开始服务", notes = "退货单-开始服务")
|
||||||
|
@AutoLog(value = "退货单-开始服务", clientType = "app")
|
||||||
|
@PostMapping(value = "/startServ")
|
||||||
|
public Result<?> startServ(@RequestBody InvoicingThdMainEntity dto) {
|
||||||
|
if (StringUtils.isBlank(dto.getId())) {
|
||||||
|
return Result.error("缺少参数");
|
||||||
|
}
|
||||||
|
boolean result = tuiHuoApi.startServ(dto);
|
||||||
|
if (result) {
|
||||||
|
return Result.OK("操作成功");
|
||||||
|
} else {
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退货单-添加退货车
|
* 退货单-添加退货车
|
||||||
*
|
*
|
||||||
|
|
@ -134,4 +155,25 @@ public class InvoicingThdApi {
|
||||||
return Result.error("操作失败");
|
return Result.error("操作失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退货单-入库退货单
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "退货单-入库退货单", notes = "退货单-入库退货单")
|
||||||
|
@AutoLog(value = "退货单-入库退货单", clientType = "app")
|
||||||
|
@PostMapping(value = "/submitThd")
|
||||||
|
public Result<?> submitThd(@RequestBody InvoicingThdMainEntity dto) {
|
||||||
|
if (StringUtils.isBlank(dto.getId())) {
|
||||||
|
return Result.error("缺少参数");
|
||||||
|
}
|
||||||
|
Map<String,String> result = tuiHuoApi.submitThd(dto);
|
||||||
|
if ("success".equals(result.get("status"))) {
|
||||||
|
return Result.OK("入库成功");
|
||||||
|
} else {
|
||||||
|
return Result.error(result.get("message"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,9 @@ public class InvoicingThdGwcEntity implements Serializable {
|
||||||
* 物料信息
|
* 物料信息
|
||||||
*/
|
*/
|
||||||
private MaterialInfoEntity materialInfo;
|
private MaterialInfoEntity materialInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑处理字段
|
||||||
|
*/
|
||||||
|
private String f1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import java.util.Date;
|
||||||
public class InvoicingThdMainEntity implements Serializable {
|
public class InvoicingThdMainEntity implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**用的是nu_biz_nu_logistics_directive_order.id*/
|
/**用的是nu_biz_nu_invoicing_directive_order.id*/
|
||||||
private String id;
|
private String id;
|
||||||
/**服务发起人*/
|
/**服务发起人*/
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,9 @@ public class NuKcslEntity implements Serializable {
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
private String id;
|
private String id;
|
||||||
/**库房id nu_warehouse_material_info.nu_id*/
|
/**
|
||||||
|
* 库房id nu_warehouse_material_info.nu_id
|
||||||
|
*/
|
||||||
private java.lang.String kfId;
|
private java.lang.String kfId;
|
||||||
/**
|
/**
|
||||||
* nuid nu_base_info.nu_id
|
* nuid nu_base_info.nu_id
|
||||||
|
|
@ -48,4 +50,8 @@ public class NuKcslEntity implements Serializable {
|
||||||
* 物料信息
|
* 物料信息
|
||||||
*/
|
*/
|
||||||
private MaterialInfoEntity materialInfo;
|
private MaterialInfoEntity materialInfo;
|
||||||
|
/**
|
||||||
|
* 是否已添加 0未添加 1已添加
|
||||||
|
*/
|
||||||
|
private String isAdd;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package org.jeecg.modules.demo.cloud.controller;
|
package org.jeecg.modules.demo.cloud.controller;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.modules.demo.cloud.service.JcloudDemoService;
|
import org.jeecg.modules.demo.cloud.service.JcloudDemoService;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ public interface ITuiHuoApi {
|
||||||
|
|
||||||
List<NuKcslEntity> thdNuMaterialList(InvoicingThdMainEntity dto);
|
List<NuKcslEntity> thdNuMaterialList(InvoicingThdMainEntity dto);
|
||||||
|
|
||||||
|
boolean startServ(InvoicingThdMainEntity dto);
|
||||||
|
|
||||||
Map<String,Object> addThc(InvoicingThdGwcEntity dto);
|
Map<String,Object> addThc(InvoicingThdGwcEntity dto);
|
||||||
|
|
||||||
List<InvoicingThdGwcEntity> thcList(InvoicingThdGwcEntity dto);
|
List<InvoicingThdGwcEntity> thcList(InvoicingThdGwcEntity dto);
|
||||||
|
|
@ -23,4 +25,7 @@ public interface ITuiHuoApi {
|
||||||
boolean removeWl(InvoicingThdGwcEntity dto);
|
boolean removeWl(InvoicingThdGwcEntity dto);
|
||||||
|
|
||||||
boolean removeAll(InvoicingThdGwcEntity dto);
|
boolean removeAll(InvoicingThdGwcEntity dto);
|
||||||
|
|
||||||
|
Map<String,String> submitThd(InvoicingThdMainEntity dto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,11 @@
|
||||||
material.lower_limit AS "materialInfo.lowerLimit",
|
material.lower_limit AS "materialInfo.lowerLimit",
|
||||||
material.tag_type AS "materialInfo.tagType",
|
material.tag_type AS "materialInfo.tagType",
|
||||||
material.iz_ybbx AS "materialInfo.izYbbx",
|
material.iz_ybbx AS "materialInfo.izYbbx",
|
||||||
material.iz_jgyh AS "materialInfo.izJgyh"
|
material.iz_jgyh AS "materialInfo.izJgyh",
|
||||||
|
if(gwc.wl_id is null, '0', '1') as isAdd
|
||||||
from nu_invoicing_nu_kcsl nukcsl
|
from nu_invoicing_nu_kcsl nukcsl
|
||||||
LEFT JOIN nu_config_material_info material ON nukcsl.wl_id = material.id
|
LEFT JOIN nu_config_material_info material ON nukcsl.wl_id = material.id
|
||||||
|
LEFT JOIN nu_invoicing_thd_gwc gwc ON nukcsl.wl_id = gwc.wl_id and pk_id = #{id}
|
||||||
<where>
|
<where>
|
||||||
<if test="nuId != null and nuId != ''">
|
<if test="nuId != null and nuId != ''">
|
||||||
and nukcsl.nu_id = #{nuId}
|
and nukcsl.nu_id = #{nuId}
|
||||||
|
|
|
||||||
|
|
@ -299,6 +299,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
result.put("status", "success");
|
result.put("status", "success");
|
||||||
result.put("message", "提交成功");
|
result.put("message", "提交成功");
|
||||||
result.put("result", ownService.queryQldByQldNo(dto.getQldNo()));
|
result.put("result", ownService.queryQldByQldNo(dto.getQldNo()));
|
||||||
|
//todo 提交(被回退后再次提交) 护理员操作的 通知给库管
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
//购物车-提交
|
//购物车-提交
|
||||||
|
|
@ -429,6 +430,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
|
|
||||||
result.put("status", "success");
|
result.put("status", "success");
|
||||||
result.put("message", "提交成功");
|
result.put("message", "提交成功");
|
||||||
|
//todo 购物车提交(把请领物料添加好后 点击提交) 护理员操作的 通知给库管
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -543,6 +545,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
one.setIzKgRead("N");//库管改为未读
|
one.setIzKgRead("N");//库管改为未读
|
||||||
one.setZfBy(sysUser.getId());//作废人
|
one.setZfBy(sysUser.getId());//作废人
|
||||||
one.setZfTime(new Date());//作废时间
|
one.setZfTime(new Date());//作废时间
|
||||||
|
//todo 作废 护理员点击作废 通知给库管
|
||||||
return invoicingQldMainService.updateById(one);
|
return invoicingQldMainService.updateById(one);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -747,7 +750,9 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
one.setIzYgRead("N");//员工改为未读
|
one.setIzYgRead("N");//员工改为未读
|
||||||
one.setHtBy(sysUser.getId());//回退人
|
one.setHtBy(sysUser.getId());//回退人
|
||||||
one.setHtTime(new Date());//回退时间
|
one.setHtTime(new Date());//回退时间
|
||||||
return invoicingQldMainService.updateById(one);
|
boolean r_ = invoicingQldMainService.updateById(one);
|
||||||
|
//todo 回退 库管点击回退 通知给护理员
|
||||||
|
return r_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -804,6 +809,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
qldData.setCkTime(new Date());//出库时间
|
qldData.setCkTime(new Date());//出库时间
|
||||||
invoicingQldMainService.update(qldData, qw);
|
invoicingQldMainService.update(qldData, qw);
|
||||||
map.put("status", "success");
|
map.put("status", "success");
|
||||||
|
//todo 出库(可以对多个请购单同时出库 qldNoArr就是请领单号) 库管点击出库 通知给护理员
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,180 @@
|
||||||
|
package com.nu.modules.thd.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
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 org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import com.nu.modules.thd.entity.NuInvoicingThdLog;
|
||||||
|
import com.nu.modules.thd.service.INuInvoicingThdLogService;
|
||||||
|
|
||||||
|
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 org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 进销存-退货-日志
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-12-04
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="进销存-退货-日志")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/thd/nuInvoicingThdLog")
|
||||||
|
@Slf4j
|
||||||
|
public class NuInvoicingThdLogController extends JeecgController<NuInvoicingThdLog, INuInvoicingThdLogService> {
|
||||||
|
@Autowired
|
||||||
|
private INuInvoicingThdLogService nuInvoicingThdLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param nuInvoicingThdLog
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "进销存-退货-日志-分页列表查询")
|
||||||
|
@ApiOperation(value="进销存-退货-日志-分页列表查询", notes="进销存-退货-日志-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<NuInvoicingThdLog>> queryPageList(NuInvoicingThdLog nuInvoicingThdLog,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<NuInvoicingThdLog> queryWrapper = QueryGenerator.initQueryWrapper(nuInvoicingThdLog, req.getParameterMap());
|
||||||
|
Page<NuInvoicingThdLog> page = new Page<NuInvoicingThdLog>(pageNo, pageSize);
|
||||||
|
IPage<NuInvoicingThdLog> pageList = nuInvoicingThdLogService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param nuInvoicingThdLog
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "进销存-退货-日志-添加")
|
||||||
|
@ApiOperation(value="进销存-退货-日志-添加", notes="进销存-退货-日志-添加")
|
||||||
|
@RequiresPermissions("thd:nu_invoicing_thd_log:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody NuInvoicingThdLog nuInvoicingThdLog) {
|
||||||
|
nuInvoicingThdLogService.save(nuInvoicingThdLog);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param nuInvoicingThdLog
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "进销存-退货-日志-编辑")
|
||||||
|
@ApiOperation(value="进销存-退货-日志-编辑", notes="进销存-退货-日志-编辑")
|
||||||
|
@RequiresPermissions("thd:nu_invoicing_thd_log:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody NuInvoicingThdLog nuInvoicingThdLog) {
|
||||||
|
nuInvoicingThdLogService.updateById(nuInvoicingThdLog);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "进销存-退货-日志-通过id删除")
|
||||||
|
@ApiOperation(value="进销存-退货-日志-通过id删除", notes="进销存-退货-日志-通过id删除")
|
||||||
|
@RequiresPermissions("thd:nu_invoicing_thd_log:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
nuInvoicingThdLogService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "进销存-退货-日志-批量删除")
|
||||||
|
@ApiOperation(value="进销存-退货-日志-批量删除", notes="进销存-退货-日志-批量删除")
|
||||||
|
@RequiresPermissions("thd:nu_invoicing_thd_log:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.nuInvoicingThdLogService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "进销存-退货-日志-通过id查询")
|
||||||
|
@ApiOperation(value="进销存-退货-日志-通过id查询", notes="进销存-退货-日志-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<NuInvoicingThdLog> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
NuInvoicingThdLog nuInvoicingThdLog = nuInvoicingThdLogService.getById(id);
|
||||||
|
if(nuInvoicingThdLog==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(nuInvoicingThdLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param nuInvoicingThdLog
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("thd:nu_invoicing_thd_log:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, NuInvoicingThdLog nuInvoicingThdLog) {
|
||||||
|
return super.exportXls(request, nuInvoicingThdLog, NuInvoicingThdLog.class, "进销存-退货-日志");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("thd:nu_invoicing_thd_log:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, NuInvoicingThdLog.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.nu.modules.thd.entity;
|
||||||
|
|
||||||
|
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 org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 进销存-退货-日志
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-12-04
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("nu_invoicing_thd_log")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="nu_invoicing_thd_log对象", description="进销存-退货-日志")
|
||||||
|
public class NuInvoicingThdLog implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**createBy*/
|
||||||
|
@ApiModelProperty(value = "createBy")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**createTime*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "createTime")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**updateBy*/
|
||||||
|
@ApiModelProperty(value = "updateBy")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**updateTime*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "updateTime")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
/**退货单id nu_invoicing_thd_main.id*/
|
||||||
|
@Excel(name = "退货单id nu_invoicing_thd_main.id", width = 15)
|
||||||
|
@ApiModelProperty(value = "退货单id nu_invoicing_thd_main.id")
|
||||||
|
private java.lang.String thdId;
|
||||||
|
/**退货单单号*/
|
||||||
|
@Excel(name = "退货单单号", width = 15)
|
||||||
|
@ApiModelProperty(value = "退货单单号")
|
||||||
|
private java.lang.String thdNo;
|
||||||
|
/**退货状态 0待执行 1已开始 2已入库 3已完成*/
|
||||||
|
@Excel(name = "退货状态 0待执行 1已开始 2已入库 3已完成", width = 15)
|
||||||
|
@ApiModelProperty(value = "退货状态 0待执行 1已开始 2已入库 3已完成")
|
||||||
|
private java.lang.String status;
|
||||||
|
/**操作人*/
|
||||||
|
@Excel(name = "操作人", width = 15)
|
||||||
|
@ApiModelProperty(value = "操作人")
|
||||||
|
private java.lang.String opeBy;
|
||||||
|
/**提交时间*/
|
||||||
|
@Excel(name = "提交时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "提交时间")
|
||||||
|
private java.util.Date opeTime;
|
||||||
|
/**nuid nu_base_info.nu_id*/
|
||||||
|
@Excel(name = "nuid nu_base_info.nu_id", width = 15)
|
||||||
|
@ApiModelProperty(value = "nuid nu_base_info.nu_id")
|
||||||
|
private java.lang.String nuId;
|
||||||
|
/**长者id nu_biz_elder_info.id*/
|
||||||
|
@Excel(name = "长者id nu_biz_elder_info.id", width = 15)
|
||||||
|
@ApiModelProperty(value = "长者id nu_biz_elder_info.id")
|
||||||
|
private java.lang.String elderId;
|
||||||
|
}
|
||||||
|
|
@ -34,9 +34,9 @@ import lombok.experimental.Accessors;
|
||||||
public class NuInvoicingThdMain implements Serializable {
|
public class NuInvoicingThdMain implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**用的是nu_biz_nu_logistics_directive_order.id*/
|
/**用的是nu_biz_nu_invoicing_directive_order.id*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
@ApiModelProperty(value = "用的是nu_biz_nu_logistics_directive_order.id")
|
@ApiModelProperty(value = "用的是nu_biz_nu_invoicing_directive_order.id")
|
||||||
private java.lang.String id;
|
private java.lang.String id;
|
||||||
/**服务发起人*/
|
/**服务发起人*/
|
||||||
@ApiModelProperty(value = "服务发起人")
|
@ApiModelProperty(value = "服务发起人")
|
||||||
|
|
@ -58,9 +58,9 @@ public class NuInvoicingThdMain implements Serializable {
|
||||||
@Excel(name = "退货单号", width = 15)
|
@Excel(name = "退货单号", width = 15)
|
||||||
@ApiModelProperty(value = "退货单号")
|
@ApiModelProperty(value = "退货单号")
|
||||||
private java.lang.String thdNo;
|
private java.lang.String thdNo;
|
||||||
/**退货状态 0待执行 1已开始 2已结束*/
|
/**退货状态 0待执行 1已开始 2已入库 3已完成*/
|
||||||
@Excel(name = "退货状态 0待执行 1已开始 2已结束", width = 15)
|
@Excel(name = "退货状态 0待执行 1已开始 2已入库 3已完成", width = 15)
|
||||||
@ApiModelProperty(value = "退货状态 0待执行 1已开始 2已结束")
|
@ApiModelProperty(value = "退货状态 0待执行 1已开始 2已入库 3已完成")
|
||||||
private java.lang.String status;
|
private java.lang.String status;
|
||||||
/**发起人*/
|
/**发起人*/
|
||||||
@Excel(name = "发起人", width = 15)
|
@Excel(name = "发起人", width = 15)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.nu.modules.thd.mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.nu.entity.InvoicingThdGwcEntity;
|
import com.nu.entity.InvoicingThdGwcEntity;
|
||||||
|
import com.nu.entity.InvoicingThdMainEntity;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.nu.modules.thd.entity.NuInvoicingThdGwc;
|
import com.nu.modules.thd.entity.NuInvoicingThdGwc;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
@ -20,4 +21,6 @@ public interface NuInvoicingThdGwcMapper extends BaseMapper<NuInvoicingThdGwc> {
|
||||||
int removeWl(InvoicingThdGwcEntity dto);
|
int removeWl(InvoicingThdGwcEntity dto);
|
||||||
|
|
||||||
int removeAll(InvoicingThdGwcEntity dto);
|
int removeAll(InvoicingThdGwcEntity dto);
|
||||||
|
|
||||||
|
List<InvoicingThdGwcEntity> validateNum(InvoicingThdMainEntity dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.nu.modules.thd.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.nu.modules.thd.entity.NuInvoicingThdLog;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 进销存-退货-日志
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-12-04
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface NuInvoicingThdLogMapper extends BaseMapper<NuInvoicingThdLog> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -52,6 +52,13 @@
|
||||||
</where>
|
</where>
|
||||||
order by thc.create_time desc
|
order by thc.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
<select id="validateNum" resultType="com.nu.entity.InvoicingThdGwcEntity">
|
||||||
|
select material.material_name as f1
|
||||||
|
from nu_invoicing_thd_gwc thc
|
||||||
|
LEFT JOIN nu_invoicing_nu_kcsl kc ON thc.wl_id = kc.wl_id
|
||||||
|
LEFT JOIN nu_config_material_info material ON thc.wl_id = material.id
|
||||||
|
where thc.pk_id = #{id} and thc.th_num > kc.wl_num
|
||||||
|
</select>
|
||||||
|
|
||||||
<delete id="removeWl">
|
<delete id="removeWl">
|
||||||
delete
|
delete
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nu.modules.thd.mapper.NuInvoicingThdLogMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.nu.modules.thd.service;
|
||||||
|
|
||||||
|
import com.nu.modules.thd.entity.NuInvoicingThdLog;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 进销存-退货-日志
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-12-04
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface INuInvoicingThdLogService extends IService<NuInvoicingThdLog> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.nu.modules.thd.service.impl;
|
||||||
|
|
||||||
|
import com.nu.modules.thd.entity.NuInvoicingThdLog;
|
||||||
|
import com.nu.modules.thd.mapper.NuInvoicingThdLogMapper;
|
||||||
|
import com.nu.modules.thd.service.INuInvoicingThdLogService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 进销存-退货-日志
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-12-04
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class NuInvoicingThdLogServiceImpl extends ServiceImpl<NuInvoicingThdLogMapper, NuInvoicingThdLog> implements INuInvoicingThdLogService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,26 +1,41 @@
|
||||||
package com.nu.modules.thd.service.impl;
|
package com.nu.modules.thd.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.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
import com.nu.entity.InvoicingOrdersEntity;
|
||||||
import com.nu.entity.InvoicingThdGwcEntity;
|
import com.nu.entity.InvoicingThdGwcEntity;
|
||||||
import com.nu.entity.InvoicingThdMainEntity;
|
import com.nu.entity.InvoicingThdMainEntity;
|
||||||
import com.nu.entity.NuKcslEntity;
|
import com.nu.entity.NuKcslEntity;
|
||||||
|
import com.nu.modules.care.api.IInvoicingOrdersApi;
|
||||||
import com.nu.modules.invoicing.api.ITuiHuoApi;
|
import com.nu.modules.invoicing.api.ITuiHuoApi;
|
||||||
import com.nu.modules.nu.entity.NuInvoicingNuKcsl;
|
import com.nu.modules.nu.entity.NuInvoicingNuKcsl;
|
||||||
import com.nu.modules.nu.mapper.NuInvoicingNuKcslMapper;
|
import com.nu.modules.nu.mapper.NuInvoicingNuKcslMapper;
|
||||||
|
import com.nu.modules.qld.entity.NuInvoicingQldMain;
|
||||||
import com.nu.modules.thd.entity.NuInvoicingThdGwc;
|
import com.nu.modules.thd.entity.NuInvoicingThdGwc;
|
||||||
|
import com.nu.modules.thd.entity.NuInvoicingThdInfo;
|
||||||
|
import com.nu.modules.thd.entity.NuInvoicingThdLog;
|
||||||
import com.nu.modules.thd.entity.NuInvoicingThdMain;
|
import com.nu.modules.thd.entity.NuInvoicingThdMain;
|
||||||
import com.nu.modules.thd.mapper.NuInvoicingThdGwcMapper;
|
import com.nu.modules.thd.mapper.NuInvoicingThdGwcMapper;
|
||||||
|
import com.nu.modules.thd.mapper.NuInvoicingThdLogMapper;
|
||||||
import com.nu.modules.thd.mapper.NuInvoicingThdMainMapper;
|
import com.nu.modules.thd.mapper.NuInvoicingThdMainMapper;
|
||||||
|
import com.nu.modules.thd.service.INuInvoicingThdInfoService;
|
||||||
|
import org.apache.commons.compress.utils.Lists;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 进销存-退货单-通用处理
|
* @Description: 进销存-退货单-通用处理
|
||||||
|
|
@ -37,6 +52,14 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
private NuInvoicingNuKcslMapper nuKcslMapper;
|
private NuInvoicingNuKcslMapper nuKcslMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private NuInvoicingThdGwcMapper thdGwcMapper;
|
private NuInvoicingThdGwcMapper thdGwcMapper;
|
||||||
|
@Autowired
|
||||||
|
private NuInvoicingThdLogMapper thdLogMapper;
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseAPI;
|
||||||
|
@Autowired
|
||||||
|
private INuInvoicingThdInfoService thdInfoService;
|
||||||
|
@Autowired
|
||||||
|
private IInvoicingOrdersApi invoicingOrdersApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<InvoicingThdMainEntity> thdList(Integer pageNo, Integer pageSize, InvoicingThdMainEntity dto) {
|
public IPage<InvoicingThdMainEntity> thdList(Integer pageNo, Integer pageSize, InvoicingThdMainEntity dto) {
|
||||||
|
|
@ -49,6 +72,39 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
return nuKcslMapper.thdNuMaterialList(dto);
|
return nuKcslMapper.thdNuMaterialList(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean startServ(InvoicingThdMainEntity dto) {
|
||||||
|
//查询当前状态
|
||||||
|
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("id", dto.getId());
|
||||||
|
NuInvoicingThdMain main = thdMainMapper.selectOne(qw);
|
||||||
|
|
||||||
|
if (main == null || !"0".equals(main.getStatus())) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String status = "1";
|
||||||
|
|
||||||
|
//更新退货单状态
|
||||||
|
main.setStatus(status);//已开始
|
||||||
|
main.setKsBy(sysUser.getId());//开始服务人
|
||||||
|
main.setKsTime(new Date());//开始服务时间
|
||||||
|
thdMainMapper.updateById(main);
|
||||||
|
|
||||||
|
//插入日志
|
||||||
|
NuInvoicingThdLog logData = new NuInvoicingThdLog();
|
||||||
|
logData.setThdId(dto.getId());//退货指令id
|
||||||
|
logData.setStatus(status);//操作状态
|
||||||
|
logData.setOpeBy(sysUser.getId());//操作人
|
||||||
|
logData.setOpeTime(new Date());//操作时间
|
||||||
|
logData.setNuId(dto.getNuId());//护理单元id
|
||||||
|
logData.setElderId(dto.getElderId());//长者id
|
||||||
|
thdLogMapper.insert(logData);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> addThc(InvoicingThdGwcEntity dto) {
|
public Map<String, Object> addThc(InvoicingThdGwcEntity dto) {
|
||||||
Map<String, Object> result = Maps.newHashMap();
|
Map<String, Object> result = Maps.newHashMap();
|
||||||
|
|
@ -103,4 +159,150 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
public boolean removeAll(InvoicingThdGwcEntity dto) {
|
public boolean removeAll(InvoicingThdGwcEntity dto) {
|
||||||
return thdGwcMapper.removeAll(dto) > 0 ? true : false;
|
return thdGwcMapper.removeAll(dto) > 0 ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库退货单(提交)
|
||||||
|
* - 检测单子状态是否正确
|
||||||
|
* - 检测购物车各物料是否大于护理单元库存
|
||||||
|
* - 修改主表状态
|
||||||
|
* - 购物车数据 挪到info表里
|
||||||
|
* - 日志记录
|
||||||
|
* - nu_biz_nu_invoicing_directive_order新增记录
|
||||||
|
* - 库房出入库日志+库存
|
||||||
|
* - 护理单元出入库日志+库存
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, String> submitThd(InvoicingThdMainEntity dto) {
|
||||||
|
Map<String, String> result = Maps.newHashMap();
|
||||||
|
|
||||||
|
//查询主表信息
|
||||||
|
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("id", dto.getId());
|
||||||
|
NuInvoicingThdMain main = thdMainMapper.selectOne(qw);
|
||||||
|
|
||||||
|
//先进行单子检测
|
||||||
|
{
|
||||||
|
//检测单子状态是否正确
|
||||||
|
if (main == null || !"1".equals(main.getStatus())) {
|
||||||
|
result.put("status", "nodeError");
|
||||||
|
result.put("message", "入库失败");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//检测购物车各物料是否大于护理单元库存
|
||||||
|
List<InvoicingThdGwcEntity> validateList = thdGwcMapper.validateNum(dto);
|
||||||
|
if (!CollectionUtils.isEmpty(validateList)) {
|
||||||
|
String wls = validateList.stream()
|
||||||
|
.map(InvoicingThdGwcEntity::getF1)
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
result.put("status", "wlError");
|
||||||
|
result.put("message", "以下物料退货数量大于护理单元库存数量:" + wls);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理数据 主表当前数据:main
|
||||||
|
{
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String status = "2";//当前节点 - 已入库
|
||||||
|
String thdNo = null;//退货单号
|
||||||
|
|
||||||
|
//生成退货单号
|
||||||
|
{
|
||||||
|
// 查询机构编码
|
||||||
|
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||||
|
String deptCode = deptInfo.getString("code");
|
||||||
|
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||||
|
|
||||||
|
// 构建今天的前缀模式
|
||||||
|
String todayPrefix = "T" + deptCode + today;
|
||||||
|
|
||||||
|
// 查询今天所有的编号
|
||||||
|
QueryWrapper<NuInvoicingThdMain> thQW = new QueryWrapper<>();
|
||||||
|
thQW.likeRight("thd_no", todayPrefix);
|
||||||
|
thQW.select("thd_no");
|
||||||
|
|
||||||
|
List<NuInvoicingThdMain> list = thdMainMapper.selectList(thQW);
|
||||||
|
int maxOrderNo = 0;
|
||||||
|
|
||||||
|
if (list != null && !list.isEmpty()) {
|
||||||
|
// 从thdNo中提取序号,找到最大值
|
||||||
|
for (NuInvoicingThdMain item : list) {
|
||||||
|
if (item.getThdNo() != null && item.getThdNo().startsWith(todayPrefix)) {
|
||||||
|
// 提取序号部分(最后几位)
|
||||||
|
String orderStr = item.getThdNo().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);
|
||||||
|
thdNo = todayPrefix + qldOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改主表状态
|
||||||
|
main.setThdNo(thdNo);//退货单号
|
||||||
|
main.setStatus(status);//已入库
|
||||||
|
main.setJsBy(sysUser.getId());//入库人
|
||||||
|
main.setJsTime(new Date());//入库时间
|
||||||
|
thdMainMapper.updateById(main);
|
||||||
|
|
||||||
|
//购物车数据 挪到info表里
|
||||||
|
{
|
||||||
|
//获取购物车物料数据
|
||||||
|
QueryWrapper<NuInvoicingThdGwc> gwcQW = new QueryWrapper<>();
|
||||||
|
gwcQW.eq("pk_id", dto.getId());
|
||||||
|
List<NuInvoicingThdGwc> gwcList = thdGwcMapper.selectList(gwcQW);
|
||||||
|
|
||||||
|
//移除购物车数据
|
||||||
|
InvoicingThdGwcEntity t_ = new InvoicingThdGwcEntity();
|
||||||
|
t_.setPkId(dto.getId());
|
||||||
|
thdGwcMapper.removeAll(t_);
|
||||||
|
|
||||||
|
//info表插入物料数据
|
||||||
|
List<NuInvoicingThdInfo> infoList = Lists.newArrayList();
|
||||||
|
for (int i = 0; i < gwcList.size(); i++) {
|
||||||
|
NuInvoicingThdGwc gwc = gwcList.get(i);//购物车取到的单条物料
|
||||||
|
NuInvoicingThdInfo info = new NuInvoicingThdInfo();
|
||||||
|
info.setThdNo(thdNo);//退货单号
|
||||||
|
info.setKfId(gwc.getKfId());//库房id
|
||||||
|
info.setWlId(gwc.getWlId());//物料id
|
||||||
|
info.setThNum(gwc.getThNum());//退货数量
|
||||||
|
info.setNuId(gwc.getNuId());//护理单元id
|
||||||
|
info.setElderId(gwc.getElderId());//长者id
|
||||||
|
infoList.add(info);
|
||||||
|
}
|
||||||
|
thdInfoService.saveBatch(infoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//日志记录
|
||||||
|
NuInvoicingThdLog logData = new NuInvoicingThdLog();
|
||||||
|
logData.setThdId(dto.getId());//退货指令id
|
||||||
|
logData.setThdNo(thdNo);//退货单号
|
||||||
|
logData.setStatus(status);//操作状态
|
||||||
|
logData.setOpeBy(sysUser.getId());//操作人
|
||||||
|
logData.setOpeTime(new Date());//操作时间
|
||||||
|
logData.setNuId(dto.getNuId());//护理单元id
|
||||||
|
logData.setElderId(dto.getElderId());//长者id
|
||||||
|
thdLogMapper.insert(logData);
|
||||||
|
|
||||||
|
//TODO 库房出入库日志+库存
|
||||||
|
|
||||||
|
//TODO 护理单元出入库日志+库存
|
||||||
|
}
|
||||||
|
|
||||||
|
result.put("status", "success");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.nu.modules.care.api;
|
package com.nu.modules.care.api;
|
||||||
|
|
||||||
|
import com.nu.entity.InvoicingOrdersEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 仓库类服务指令工单主表
|
* @Description: 仓库类服务指令工单主表
|
||||||
* @Author: zmy
|
* @Author: zmy
|
||||||
|
|
@ -7,4 +9,6 @@ package com.nu.modules.care.api;
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IInvoicingOrdersApi {
|
public interface IInvoicingOrdersApi {
|
||||||
|
//插入数据
|
||||||
|
int insertData(InvoicingOrdersEntity orderEntity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.nu.modules.biz.invoicing.order.service.impl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
import com.nu.entity.InvoicingOrdersEntity;
|
||||||
import com.nu.modules.biz.invoicing.order.entity.InvoicingOrders;
|
import com.nu.modules.biz.invoicing.order.entity.InvoicingOrders;
|
||||||
import com.nu.modules.biz.invoicing.order.mapper.InvoicingOrdersMapper;
|
import com.nu.modules.biz.invoicing.order.mapper.InvoicingOrdersMapper;
|
||||||
import com.nu.modules.biz.invoicing.order.service.IInvoicingOrdersService;
|
import com.nu.modules.biz.invoicing.order.service.IInvoicingOrdersService;
|
||||||
|
|
@ -13,6 +14,7 @@ import com.nu.modules.config.sendorderpriority.service.ISendOrderRuleService;
|
||||||
import com.nu.modules.config.sendorderpriority.service.ISendOrderRuleSubService;
|
import com.nu.modules.config.sendorderpriority.service.ISendOrderRuleSubService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -436,4 +438,11 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
|
||||||
System.out.println("获取指定护理员工信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName());
|
System.out.println("获取指定护理员工信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertData(InvoicingOrdersEntity orderEntity) {
|
||||||
|
InvoicingOrders data = new InvoicingOrders();
|
||||||
|
BeanUtils.copyProperties(orderEntity,data);
|
||||||
|
return baseMapper.insert(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue