Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -4,6 +4,8 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.shzg.framework.aspectj.lang.annotation.DataScope;
|
||||
import com.shzg.project.worn.domain.dto.WornInboundItemDTO;
|
||||
import com.shzg.project.worn.domain.dto.WornScanCodeDTO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -103,10 +105,27 @@ public class WornUniqueCodeController extends BaseController
|
||||
{
|
||||
return toAjax(wornUniqueCodeService.deleteWornUniqueCodeByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 根据唯一码编号查询物料信息
|
||||
*
|
||||
* @param code 唯一码编号
|
||||
* @return 物料信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:uniqueCode:list')")
|
||||
@GetMapping("/materialInfo/{code}")
|
||||
public AjaxResult getMaterialInfo(@PathVariable("code") Integer code)
|
||||
{
|
||||
return AjaxResult.success(wornUniqueCodeService.selectMaterialInfoByCode(code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库扫码查询物料信息
|
||||
*/
|
||||
@PostMapping("/getMaterialInfo")
|
||||
public AjaxResult getMaterialInfo(@RequestBody WornScanCodeDTO dto)
|
||||
{
|
||||
List<WornInboundItemDTO> list =
|
||||
wornUniqueCodeService.selectMaterialInfoForOutbound(dto.getCode(), dto.getExistList());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,4 +66,9 @@ public interface WornUniqueCodeMaterialMapper
|
||||
* @return
|
||||
*/
|
||||
WornUniqueCodeMaterial selectWithMaterialByUniqueCodeId(Long id);
|
||||
/**
|
||||
* 更新唯一码状态
|
||||
* */
|
||||
public int updateDeleteByUniqueCodeId(Long uniqueCodeId);
|
||||
|
||||
}
|
||||
|
||||
@@ -58,5 +58,12 @@ public interface IWornUniqueCodeService
|
||||
* @return 物料信息列表
|
||||
*/
|
||||
List<WornInboundItemDTO> selectMaterialInfoByCode(Integer code);
|
||||
/**
|
||||
* 根据唯一码编号查询物料信息(出库)
|
||||
*
|
||||
* @param code 唯一码编号
|
||||
* @return 物料信息列表
|
||||
*/
|
||||
List<WornInboundItemDTO> selectMaterialInfoForOutbound(Integer code, List<Integer> existList);
|
||||
|
||||
}
|
||||
|
||||
@@ -272,4 +272,55 @@ public class WornUniqueCodeServiceImpl implements IWornUniqueCodeService
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WornInboundItemDTO> selectMaterialInfoForOutbound(Integer code, List<Integer> existList)
|
||||
{
|
||||
/* ================== 1. 参数校验 ================== */
|
||||
if (code == null)
|
||||
{
|
||||
throw new RuntimeException("唯一码不能为空");
|
||||
}
|
||||
if (existList != null && existList.contains(code))
|
||||
{
|
||||
throw new RuntimeException("该唯一码已扫描,请勿重复添加");
|
||||
}
|
||||
/* ================== 2. 查询物料信息 ================== */
|
||||
List<WornInboundItemDTO> dto = wornUniqueCodeMapper.selectMaterialInfoByCode(code);
|
||||
|
||||
if (dto == null || dto.isEmpty())
|
||||
{
|
||||
throw new RuntimeException("未查询到对应物料信息");
|
||||
}
|
||||
|
||||
/* ================== 3. 状态校验 ================== */
|
||||
for (WornInboundItemDTO item : dto)
|
||||
{
|
||||
String status = item.getStatus();
|
||||
|
||||
if (StringUtils.isEmpty(status))
|
||||
{
|
||||
throw new RuntimeException("唯一码状态异常");
|
||||
}
|
||||
|
||||
// ❗只允许已入库(2)出库
|
||||
if (!"2".equals(status)){
|
||||
if ("0".equals(status)){
|
||||
throw new RuntimeException("唯一码未入库,不能出库");
|
||||
}else if ("1".equals(status)){
|
||||
throw new RuntimeException("唯一码仅生成入库单,尚未入库");
|
||||
}else if ("3".equals(status)){
|
||||
throw new RuntimeException("唯一码已生成出库单,请勿重复操作");
|
||||
}else if ("4".equals(status)){
|
||||
throw new RuntimeException("唯一码已完成出库");
|
||||
}else if ("9".equals(status)){
|
||||
throw new RuntimeException("唯一码已作废");
|
||||
}else{
|
||||
throw new RuntimeException("唯一码状态异常:" + status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.shzg.project.worn.controller;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.shzg.common.utils.SecurityUtils;
|
||||
import com.shzg.project.worn.domain.dto.WornInboundPartialFinishDTO;
|
||||
import com.shzg.project.worn.domain.dto.WornInboundUpdateDTO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -38,6 +39,10 @@ public class WornInboundBillController extends BaseController
|
||||
public TableDataInfo list(WornInboundBill wornInboundBill)
|
||||
{
|
||||
startPage();
|
||||
if (!SecurityUtils.isAdmin())
|
||||
{
|
||||
wornInboundBill.setProjectId(SecurityUtils.getDeptId());
|
||||
}
|
||||
List<WornInboundBill> list = wornInboundBillService.selectWornInboundBillList(wornInboundBill);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.shzg.project.worn.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.shzg.common.utils.SecurityUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.shzg.framework.aspectj.lang.annotation.Log;
|
||||
import com.shzg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.shzg.project.worn.domain.WornOutboundBill;
|
||||
import com.shzg.project.worn.service.IWornOutboundBillService;
|
||||
import com.shzg.framework.web.controller.BaseController;
|
||||
import com.shzg.framework.web.domain.AjaxResult;
|
||||
import com.shzg.common.utils.poi.ExcelUtil;
|
||||
import com.shzg.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 出库单据Controller
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/worn/outboundBill")
|
||||
public class WornOutboundBillController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWornOutboundBillService wornOutboundBillService;
|
||||
|
||||
/**
|
||||
* 查询出库单据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundBill:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WornOutboundBill wornOutboundBill)
|
||||
{
|
||||
startPage();
|
||||
if (!SecurityUtils.isAdmin())
|
||||
{
|
||||
wornOutboundBill.setProjectId(SecurityUtils.getDeptId());
|
||||
}
|
||||
List<WornOutboundBill> list = wornOutboundBillService.selectWornOutboundBillList(wornOutboundBill);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出库单据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundBill:export')")
|
||||
@Log(title = "出库单据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WornOutboundBill wornOutboundBill)
|
||||
{
|
||||
List<WornOutboundBill> list = wornOutboundBillService.selectWornOutboundBillList(wornOutboundBill);
|
||||
ExcelUtil<WornOutboundBill> util = new ExcelUtil<WornOutboundBill>(WornOutboundBill.class);
|
||||
util.exportExcel(response, list, "出库单据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出库单据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundBill:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wornOutboundBillService.selectWornOutboundBillById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundBill:add')")
|
||||
@Log(title = "出库单据", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody WornOutboundBill wornOutboundBill)
|
||||
{
|
||||
return toAjax(wornOutboundBillService.insertWornOutboundBill(wornOutboundBill));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundBill:edit')")
|
||||
@Log(title = "出库单据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WornOutboundBill wornOutboundBill)
|
||||
{
|
||||
return toAjax(wornOutboundBillService.updateWornOutboundBill(wornOutboundBill));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundBill:remove')")
|
||||
@Log(title = "出库单据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wornOutboundBillService.deleteWornOutboundBillByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 完成出库
|
||||
*/
|
||||
@PostMapping("/complete")
|
||||
public AjaxResult complete(@RequestBody WornOutboundBill wornOutboundBill)
|
||||
{
|
||||
return toAjax(wornOutboundBillService.completeWornOutboundBill(wornOutboundBill));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.shzg.project.worn.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.shzg.project.worn.domain.dto.WornOutboundUpdateDTO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.shzg.framework.aspectj.lang.annotation.Log;
|
||||
import com.shzg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.shzg.project.worn.domain.WornOutboundItem;
|
||||
import com.shzg.project.worn.service.IWornOutboundItemService;
|
||||
import com.shzg.framework.web.controller.BaseController;
|
||||
import com.shzg.framework.web.domain.AjaxResult;
|
||||
import com.shzg.common.utils.poi.ExcelUtil;
|
||||
import com.shzg.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 出库单明细Controller
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/worn/outboundItem")
|
||||
public class WornOutboundItemController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWornOutboundItemService wornOutboundItemService;
|
||||
|
||||
/**
|
||||
* 查询出库单明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundItem:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WornOutboundItem wornOutboundItem)
|
||||
{
|
||||
startPage();
|
||||
List<WornOutboundItem> list = wornOutboundItemService.selectWornOutboundItemList(wornOutboundItem);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出库单明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundItem:export')")
|
||||
@Log(title = "出库单明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WornOutboundItem wornOutboundItem)
|
||||
{
|
||||
List<WornOutboundItem> list = wornOutboundItemService.selectWornOutboundItemList(wornOutboundItem);
|
||||
ExcelUtil<WornOutboundItem> util = new ExcelUtil<WornOutboundItem>(WornOutboundItem.class);
|
||||
util.exportExcel(response, list, "出库单明细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出库单明细详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundItem:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wornOutboundItemService.selectWornOutboundItemById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库单明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundItem:add')")
|
||||
@Log(title = "出库单明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WornOutboundItem wornOutboundItem)
|
||||
{
|
||||
return toAjax(wornOutboundItemService.insertWornOutboundItem(wornOutboundItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库单明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundItem:edit')")
|
||||
@Log(title = "出库单明细", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
public AjaxResult edit(@RequestBody WornOutboundUpdateDTO dto)
|
||||
{
|
||||
return toAjax(wornOutboundItemService.updateWornOutboundItem(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库单明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:outboundItem:remove')")
|
||||
@Log(title = "出库单明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wornOutboundItemService.deleteWornOutboundItemByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 根据出库单号查询出库单明细
|
||||
*/
|
||||
@PostMapping("/getByBillNo")
|
||||
public AjaxResult getByBillNo(@RequestBody WornOutboundItem wornOutboundItem)
|
||||
{
|
||||
WornOutboundUpdateDTO dto = wornOutboundItemService.selectWornOutboundItemByBillNo(wornOutboundItem);
|
||||
return AjaxResult.success(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.shzg.project.worn.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.shzg.project.worn.domain.dto.WornTechnicalAppraisalSimpleDTO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.shzg.framework.aspectj.lang.annotation.Log;
|
||||
import com.shzg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.shzg.project.worn.domain.WornTechnicalAppraisal;
|
||||
import com.shzg.project.worn.service.IWornTechnicalAppraisalService;
|
||||
import com.shzg.framework.web.controller.BaseController;
|
||||
import com.shzg.framework.web.domain.AjaxResult;
|
||||
import com.shzg.common.utils.poi.ExcelUtil;
|
||||
import com.shzg.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 技术鉴定Controller
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/worn/appraisal")
|
||||
public class WornTechnicalAppraisalController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWornTechnicalAppraisalService wornTechnicalAppraisalService;
|
||||
|
||||
/**
|
||||
* 查询技术鉴定列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:appraisal:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WornTechnicalAppraisal wornTechnicalAppraisal)
|
||||
{
|
||||
startPage();
|
||||
List<WornTechnicalAppraisal> list = wornTechnicalAppraisalService.selectWornTechnicalAppraisalList(wornTechnicalAppraisal);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出技术鉴定列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:appraisal:export')")
|
||||
@Log(title = "技术鉴定", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WornTechnicalAppraisal wornTechnicalAppraisal)
|
||||
{
|
||||
List<WornTechnicalAppraisal> list = wornTechnicalAppraisalService.selectWornTechnicalAppraisalList(wornTechnicalAppraisal);
|
||||
ExcelUtil<WornTechnicalAppraisal> util = new ExcelUtil<WornTechnicalAppraisal>(WornTechnicalAppraisal.class);
|
||||
util.exportExcel(response, list, "技术鉴定数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取技术鉴定详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:appraisal:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wornTechnicalAppraisalService.selectWornTechnicalAppraisalById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增技术鉴定
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:appraisal:add')")
|
||||
@Log(title = "技术鉴定", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WornTechnicalAppraisal wornTechnicalAppraisal)
|
||||
{
|
||||
return toAjax(wornTechnicalAppraisalService.insertWornTechnicalAppraisal(wornTechnicalAppraisal));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改技术鉴定
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:appraisal:edit')")
|
||||
@Log(title = "技术鉴定", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WornTechnicalAppraisal wornTechnicalAppraisal)
|
||||
{
|
||||
return toAjax(wornTechnicalAppraisalService.updateWornTechnicalAppraisal(wornTechnicalAppraisal));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除技术鉴定
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:appraisal:remove')")
|
||||
@Log(title = "技术鉴定", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wornTechnicalAppraisalService.deleteWornTechnicalAppraisalByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 新增技术鉴定表(含附件)
|
||||
*/
|
||||
@PostMapping("/addWithFiles")
|
||||
public AjaxResult addWithFiles(@RequestBody WornTechnicalAppraisal wornTechnicalAppraisal)
|
||||
{
|
||||
return toAjax(wornTechnicalAppraisalService.insertWornTechnicalAppraisalWithFiles(wornTechnicalAppraisal));
|
||||
}
|
||||
@GetMapping("/myList")
|
||||
public TableDataInfo myList()
|
||||
{
|
||||
startPage();
|
||||
return wornTechnicalAppraisalService.selectMyTechnicalAppraisalSimplePageList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.shzg.project.worn.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.shzg.project.worn.domain.dto.FileUrlDTO;
|
||||
import com.shzg.project.worn.service.impl.WornTechnicalAppraisalFileServiceImpl;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.shzg.framework.aspectj.lang.annotation.Log;
|
||||
import com.shzg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.shzg.project.worn.domain.WornTechnicalAppraisalFile;
|
||||
import com.shzg.project.worn.service.IWornTechnicalAppraisalFileService;
|
||||
import com.shzg.framework.web.controller.BaseController;
|
||||
import com.shzg.framework.web.domain.AjaxResult;
|
||||
import com.shzg.common.utils.poi.ExcelUtil;
|
||||
import com.shzg.framework.web.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 技术鉴定附件Controller
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/worn/technicalFile")
|
||||
public class WornTechnicalAppraisalFileController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWornTechnicalAppraisalFileService wornTechnicalAppraisalFileService;
|
||||
private static final Logger log = LoggerFactory.getLogger(WornTechnicalAppraisalFileServiceImpl.class);
|
||||
|
||||
/**
|
||||
* 查询技术鉴定附件列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:technicalFile:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WornTechnicalAppraisalFile wornTechnicalAppraisalFile)
|
||||
{
|
||||
startPage();
|
||||
List<WornTechnicalAppraisalFile> list = wornTechnicalAppraisalFileService.selectWornTechnicalAppraisalFileList(wornTechnicalAppraisalFile);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出技术鉴定附件列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:technicalFile:export')")
|
||||
@Log(title = "技术鉴定附件", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WornTechnicalAppraisalFile wornTechnicalAppraisalFile)
|
||||
{
|
||||
List<WornTechnicalAppraisalFile> list = wornTechnicalAppraisalFileService.selectWornTechnicalAppraisalFileList(wornTechnicalAppraisalFile);
|
||||
ExcelUtil<WornTechnicalAppraisalFile> util = new ExcelUtil<WornTechnicalAppraisalFile>(WornTechnicalAppraisalFile.class);
|
||||
util.exportExcel(response, list, "技术鉴定附件数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取技术鉴定附件详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:technicalFile:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wornTechnicalAppraisalFileService.selectWornTechnicalAppraisalFileById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增技术鉴定附件
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:technicalFile:add')")
|
||||
@Log(title = "技术鉴定附件", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WornTechnicalAppraisalFile wornTechnicalAppraisalFile)
|
||||
{
|
||||
return toAjax(wornTechnicalAppraisalFileService.insertWornTechnicalAppraisalFile(wornTechnicalAppraisalFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改技术鉴定附件
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:technicalFile:edit')")
|
||||
@Log(title = "技术鉴定附件", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WornTechnicalAppraisalFile wornTechnicalAppraisalFile)
|
||||
{
|
||||
return toAjax(wornTechnicalAppraisalFileService.updateWornTechnicalAppraisalFile(wornTechnicalAppraisalFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除技术鉴定附件
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('worn:technicalFile:remove')")
|
||||
@Log(title = "技术鉴定附件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wornTechnicalAppraisalFileService.deleteWornTechnicalAppraisalFileByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 多张图片上传
|
||||
* 前端参数:
|
||||
* file: 多个同名文件字段
|
||||
* scene: 场景
|
||||
* bizType: 业务类型
|
||||
*/
|
||||
@Log(title = "技术鉴定附件上传", businessType = BusinessType.OTHER)
|
||||
@PostMapping(value = "/upload", consumes = "multipart/form-data")
|
||||
public AjaxResult uploadBatch(@RequestParam("file") MultipartFile[] files,
|
||||
@RequestParam("scene") String scene,
|
||||
@RequestParam("bizType") String bizType,
|
||||
HttpServletRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<FileUrlDTO> list = wornTechnicalAppraisalFileService.uploadBatch(files, scene, bizType, request);
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("fileUrlList", list);
|
||||
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.error("技术鉴定附件批量上传失败", e);
|
||||
return AjaxResult.error("上传失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.shzg.project.worn.domain;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "file")
|
||||
public class FileUploadConfig
|
||||
{
|
||||
/**
|
||||
* 文件上传根路径
|
||||
*/
|
||||
private String uploadPath;
|
||||
|
||||
public String getUploadPath()
|
||||
{
|
||||
return uploadPath;
|
||||
}
|
||||
|
||||
public void setUploadPath(String uploadPath)
|
||||
{
|
||||
this.uploadPath = uploadPath;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.shzg.project.worn.domain;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class ResourceConfig implements WebMvcConfigurer
|
||||
{
|
||||
@Autowired
|
||||
private FileUploadConfig fileUploadConfig;
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry)
|
||||
{
|
||||
registry.addResourceHandler("/profile/**")
|
||||
.addResourceLocations("file:" + fileUploadConfig.getUploadPath() + "/");
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,10 @@ public class WornInboundBill extends BaseEntity
|
||||
@Excel(name = "逻辑删除", readConverterExp = "0=正常,1=删除")
|
||||
private String isDelete;
|
||||
|
||||
/** 项目ID(用于数据隔离,对应sys_dept.id) */
|
||||
@Excel(name = "项目ID", readConverterExp = "用于数据隔离,对应sys_dept.id")
|
||||
private Long projectId;
|
||||
|
||||
/** ================== 新增:明细列表 ================== */
|
||||
private List<WornInboundItem> itemList;
|
||||
|
||||
@@ -91,7 +95,15 @@ public class WornInboundBill extends BaseEntity
|
||||
|
||||
public List<WornInboundItem> getItemList() { return itemList; }
|
||||
public void setItemList(List<WornInboundItem> itemList) { this.itemList = itemList; }
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
201
src/main/java/com/shzg/project/worn/domain/WornOutboundBill.java
Normal file
201
src/main/java/com/shzg/project/worn/domain/WornOutboundBill.java
Normal file
@@ -0,0 +1,201 @@
|
||||
package com.shzg.project.worn.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.shzg.framework.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.shzg.framework.aspectj.lang.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 出库单据对象 worn_outbound_bill
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
public class WornOutboundBill extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 出库单号 */
|
||||
@Excel(name = "出库单号")
|
||||
private String billNo;
|
||||
|
||||
/** 出库类型(0普通出库 1处置出库 等) */
|
||||
@Excel(name = "出库类型", readConverterExp = "0=普通出库,1=处置出库,等=")
|
||||
private String billType;
|
||||
|
||||
/** 仓库编码 */
|
||||
@Excel(name = "仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 库区编码 */
|
||||
@Excel(name = "库区编码")
|
||||
private String areaCode;
|
||||
|
||||
/** 库区名称 */
|
||||
@Excel(name = "库区名称")
|
||||
private String areaName;
|
||||
|
||||
/** 出库时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date outboundTime;
|
||||
|
||||
/** 状态(0待出库 1已出库) */
|
||||
@Excel(name = "状态", readConverterExp = "0=待出库,1=已出库")
|
||||
private String status;
|
||||
|
||||
/** 逻辑删除(0正常 1删除) */
|
||||
@Excel(name = "逻辑删除", readConverterExp = "0=正常,1=删除")
|
||||
private String isDelete;
|
||||
|
||||
/** 项目ID(数据隔离) */
|
||||
@Excel(name = "项目ID", readConverterExp = "数=据隔离")
|
||||
private Long projectId;
|
||||
/** ================== 新增:明细列表 ================== */
|
||||
private List<WornOutboundItem> itemList;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setBillNo(String billNo)
|
||||
{
|
||||
this.billNo = billNo;
|
||||
}
|
||||
|
||||
public String getBillNo()
|
||||
{
|
||||
return billNo;
|
||||
}
|
||||
|
||||
public void setBillType(String billType)
|
||||
{
|
||||
this.billType = billType;
|
||||
}
|
||||
|
||||
public String getBillType()
|
||||
{
|
||||
return billType;
|
||||
}
|
||||
|
||||
public void setWarehouseCode(String warehouseCode)
|
||||
{
|
||||
this.warehouseCode = warehouseCode;
|
||||
}
|
||||
|
||||
public String getWarehouseCode()
|
||||
{
|
||||
return warehouseCode;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName)
|
||||
{
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getWarehouseName()
|
||||
{
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode)
|
||||
{
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaCode()
|
||||
{
|
||||
return areaCode;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName)
|
||||
{
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaName()
|
||||
{
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setOutboundTime(Date outboundTime)
|
||||
{
|
||||
this.outboundTime = outboundTime;
|
||||
}
|
||||
|
||||
public Date getOutboundTime()
|
||||
{
|
||||
return outboundTime;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public List<WornOutboundItem> getItemList() { return itemList; }
|
||||
public void setItemList(List<WornOutboundItem> itemList) { this.itemList = itemList; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("billNo", getBillNo())
|
||||
.append("billType", getBillType())
|
||||
.append("warehouseCode", getWarehouseCode())
|
||||
.append("warehouseName", getWarehouseName())
|
||||
.append("areaCode", getAreaCode())
|
||||
.append("areaName", getAreaName())
|
||||
.append("remark", getRemark())
|
||||
.append("outboundTime", getOutboundTime())
|
||||
.append("status", getStatus())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("projectId", getProjectId())
|
||||
.append("itemList", getItemList())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
309
src/main/java/com/shzg/project/worn/domain/WornOutboundItem.java
Normal file
309
src/main/java/com/shzg/project/worn/domain/WornOutboundItem.java
Normal file
@@ -0,0 +1,309 @@
|
||||
package com.shzg.project.worn.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.shzg.framework.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.shzg.framework.aspectj.lang.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 出库单明细对象 worn_outbound_item
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
public class WornOutboundItem extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 出库单ID */
|
||||
@Excel(name = "出库单ID")
|
||||
private Long billId;
|
||||
|
||||
/** 出库单号 */
|
||||
@Excel(name = "出库单号")
|
||||
private String billNo;
|
||||
|
||||
/** 物料ID */
|
||||
@Excel(name = "物料ID")
|
||||
private Long materialId;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 唯一码 */
|
||||
@Excel(name = "唯一码")
|
||||
private Integer uniqueCode;
|
||||
|
||||
/** 明细状态(0待出库 1已出库) */
|
||||
@Excel(name = "明细状态", readConverterExp = "0=待出库,1=已出库")
|
||||
private String status;
|
||||
|
||||
/** 是否删除(0正常 1删除) */
|
||||
@Excel(name = "是否删除", readConverterExp = "0=正常,1=删除")
|
||||
private String isDelete;
|
||||
// ================== 物料扩展信息(查询用,不入库) ==================
|
||||
/** ================== 新增:明细列表 ================== */
|
||||
private List<WornMaterial> itemList;
|
||||
/** 物料名称 */
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/** 物料简称 */
|
||||
@Excel(name = "物料简称")
|
||||
private String materialShortName;
|
||||
|
||||
/** 物料编码 */
|
||||
@Excel(name = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
/** 规格 */
|
||||
@Excel(name = "规格")
|
||||
private String specification;
|
||||
|
||||
/** 型号 */
|
||||
@Excel(name = "型号")
|
||||
private String model;
|
||||
/** 仓库编码 */
|
||||
private String warehouseCode;
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
/** 存储区编码 */
|
||||
private String areaCode;
|
||||
/** 存储区名称 */
|
||||
@Excel(name = "存储区名称")
|
||||
private String areaName;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
/** 入库时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date outboundTime;
|
||||
/** 单件重量 */
|
||||
@Excel(name = "单件重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
/** 单据备注 */
|
||||
@Excel(name = "单据备注")
|
||||
private String billRemark;
|
||||
/** 入库单类型(0=入库申请,1=入库成功,2=出库申请,3=出库成功,4=已作废") */
|
||||
private String billType;
|
||||
/** 物资类型 */
|
||||
private String typeName;
|
||||
/** 父级类型名称 */
|
||||
private String typeParentNames;
|
||||
/** 物料单位ID */
|
||||
private Long unitId;
|
||||
/** 单位名称 */
|
||||
private String unitName;
|
||||
|
||||
/** 主单据状态 */
|
||||
private String billStatus;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setBillId(Long billId)
|
||||
{
|
||||
this.billId = billId;
|
||||
}
|
||||
|
||||
public Long getBillId()
|
||||
{
|
||||
return billId;
|
||||
}
|
||||
|
||||
public void setBillNo(String billNo)
|
||||
{
|
||||
this.billNo = billNo;
|
||||
}
|
||||
|
||||
public String getBillNo()
|
||||
{
|
||||
return billNo;
|
||||
}
|
||||
|
||||
public void setMaterialId(Long materialId)
|
||||
{
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public Long getMaterialId()
|
||||
{
|
||||
return materialId;
|
||||
}
|
||||
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public Integer getUniqueCode() { return uniqueCode; }
|
||||
public void setUniqueCode(Integer uniqueCode) { this.uniqueCode = uniqueCode; }
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
public List<WornMaterial> getItemList() { return itemList; }
|
||||
public void setItemList(List<WornMaterial> itemList) { this.itemList = itemList; }
|
||||
public String getBillType() { return billType; }
|
||||
public void setBillType(String billType) { this.billType = billType; }
|
||||
public String getWarehouseCode() { return warehouseCode; }
|
||||
public void setWarehouseCode(String warehouseCode) { this.warehouseCode = warehouseCode; }
|
||||
|
||||
public String getAreaCode() { return areaCode; }
|
||||
public void setAreaCode(String areaCode) { this.areaCode = areaCode; }
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public void setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
}
|
||||
public String getTypeParentNames() {
|
||||
return typeParentNames;
|
||||
}
|
||||
|
||||
public void setTypeParentNames(String typeParentNames) {
|
||||
this.typeParentNames = typeParentNames;
|
||||
}
|
||||
public Long getUnitId() {
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setUnitId(Long unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
public void setUnitName(String unitName)
|
||||
{
|
||||
this.unitName = unitName;
|
||||
}
|
||||
|
||||
public String getUnitName()
|
||||
{
|
||||
return unitName;
|
||||
}
|
||||
public void setBillStatus(String billStatus)
|
||||
{
|
||||
this.billStatus = billStatus;
|
||||
}
|
||||
|
||||
public String getBillStatus()
|
||||
{
|
||||
return billStatus;
|
||||
}
|
||||
public String getWarehouseName() {
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName) {
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.Date getCreateTime() {
|
||||
return super.getCreateTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCreateTime(java.util.Date createTime) {
|
||||
super.setCreateTime(createTime);
|
||||
}
|
||||
public Date getOutboundTime() {
|
||||
return outboundTime;
|
||||
}
|
||||
|
||||
public void setOutboundTime(Date outboundTime) {
|
||||
this.outboundTime = outboundTime;
|
||||
}
|
||||
public BigDecimal getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(BigDecimal weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public String getBillRemark() {
|
||||
return billRemark;
|
||||
}
|
||||
|
||||
public void setBillRemark(String billRemark) {
|
||||
this.billRemark = billRemark;
|
||||
}
|
||||
public String getMaterialName() { return materialName; }
|
||||
public void setMaterialName(String materialName) { this.materialName = materialName; }
|
||||
public String getMaterialCode() { return materialCode; }
|
||||
public void setMaterialCode(String materialCode) { this.materialCode = materialCode; }
|
||||
public String getModel() { return model; }
|
||||
public void setModel(String model) { this.model = model; }
|
||||
public String getMaterialShortName() { return materialShortName; }
|
||||
public void setMaterialShortName(String materialShortName) { this.materialShortName = materialShortName; }
|
||||
public String getSpecification() { return specification; }
|
||||
public void setSpecification(String specification) { this.specification = specification; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("billId", getBillId())
|
||||
.append("billNo", getBillNo())
|
||||
.append("materialId", getMaterialId())
|
||||
.append("quantity", getQuantity())
|
||||
.append("uniqueCode", getUniqueCode())
|
||||
.append("remark", getRemark())
|
||||
.append("status", getStatus())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.shzg.project.worn.domain;
|
||||
|
||||
import com.shzg.framework.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.shzg.framework.aspectj.lang.annotation.Excel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 技术鉴定对象 worn_technical_appraisal
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
public class WornTechnicalAppraisal extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 技术鉴定单号 */
|
||||
@Excel(name = "技术鉴定单号")
|
||||
private String appraisalNo;
|
||||
|
||||
/** 出库单ID */
|
||||
@Excel(name = "出库单ID")
|
||||
private Long billId;
|
||||
|
||||
/** 出库单号 */
|
||||
@Excel(name = "出库单号")
|
||||
private String billNo;
|
||||
|
||||
/** 项目ID */
|
||||
@Excel(name = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/** 上传人ID */
|
||||
@Excel(name = "上传人ID")
|
||||
private Long userId;
|
||||
|
||||
/** 上传人姓名 */
|
||||
@Excel(name = "上传人姓名")
|
||||
private String userName;
|
||||
|
||||
/** 技术鉴定说明 */
|
||||
@Excel(name = "技术鉴定说明")
|
||||
private String appraisalDesc;
|
||||
|
||||
/** 状态(0草稿 1已提交) */
|
||||
@Excel(name = "状态", readConverterExp = "0=草稿,1=已提交")
|
||||
private String status;
|
||||
|
||||
/** 是否删除(0正常 1删除) */
|
||||
@Excel(name = "是否删除", readConverterExp = "0=正常,1=删除")
|
||||
private String isDelete;
|
||||
/** 附件列表 */
|
||||
private List<WornTechnicalAppraisalFile> fileList;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setAppraisalNo(String appraisalNo)
|
||||
{
|
||||
this.appraisalNo = appraisalNo;
|
||||
}
|
||||
|
||||
public String getAppraisalNo()
|
||||
{
|
||||
return appraisalNo;
|
||||
}
|
||||
|
||||
public void setBillId(Long billId)
|
||||
{
|
||||
this.billId = billId;
|
||||
}
|
||||
|
||||
public Long getBillId()
|
||||
{
|
||||
return billId;
|
||||
}
|
||||
|
||||
public void setBillNo(String billNo)
|
||||
{
|
||||
this.billNo = billNo;
|
||||
}
|
||||
|
||||
public String getBillNo()
|
||||
{
|
||||
return billNo;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setAppraisalDesc(String appraisalDesc)
|
||||
{
|
||||
this.appraisalDesc = appraisalDesc;
|
||||
}
|
||||
|
||||
public String getAppraisalDesc()
|
||||
{
|
||||
return appraisalDesc;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
public List<WornTechnicalAppraisalFile> getFileList()
|
||||
{
|
||||
return fileList;
|
||||
}
|
||||
|
||||
public void setFileList(List<WornTechnicalAppraisalFile> fileList)
|
||||
{
|
||||
this.fileList = fileList;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("appraisalNo", getAppraisalNo())
|
||||
.append("billId", getBillId())
|
||||
.append("billNo", getBillNo())
|
||||
.append("projectId", getProjectId())
|
||||
.append("userId", getUserId())
|
||||
.append("userName", getUserName())
|
||||
.append("appraisalDesc", getAppraisalDesc())
|
||||
.append("status", getStatus())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.shzg.project.worn.domain;
|
||||
|
||||
import com.shzg.framework.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.shzg.framework.aspectj.lang.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 技术鉴定附件对象 worn_technical_appraisal_file
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
public class WornTechnicalAppraisalFile extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 技术鉴定表ID */
|
||||
@Excel(name = "技术鉴定表ID")
|
||||
private Long appraisalId;
|
||||
|
||||
/** 文件名 */
|
||||
@Excel(name = "文件名")
|
||||
private String fileName;
|
||||
|
||||
/** 文件地址 */
|
||||
@Excel(name = "文件地址")
|
||||
private String fileUrl;
|
||||
|
||||
/** 文件类型 */
|
||||
@Excel(name = "文件类型")
|
||||
private String fileType;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Long sortNum;
|
||||
|
||||
/** 是否删除(0正常 1删除) */
|
||||
@Excel(name = "是否删除", readConverterExp = "0=正常,1=删除")
|
||||
private String isDelete;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setAppraisalId(Long appraisalId)
|
||||
{
|
||||
this.appraisalId = appraisalId;
|
||||
}
|
||||
|
||||
public Long getAppraisalId()
|
||||
{
|
||||
return appraisalId;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName)
|
||||
{
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFileName()
|
||||
{
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileUrl(String fileUrl)
|
||||
{
|
||||
this.fileUrl = fileUrl;
|
||||
}
|
||||
|
||||
public String getFileUrl()
|
||||
{
|
||||
return fileUrl;
|
||||
}
|
||||
|
||||
public void setFileType(String fileType)
|
||||
{
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
public String getFileType()
|
||||
{
|
||||
return fileType;
|
||||
}
|
||||
|
||||
public void setSortNum(Long sortNum)
|
||||
{
|
||||
this.sortNum = sortNum;
|
||||
}
|
||||
|
||||
public Long getSortNum()
|
||||
{
|
||||
return sortNum;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("appraisalId", getAppraisalId())
|
||||
.append("fileName", getFileName())
|
||||
.append("fileUrl", getFileUrl())
|
||||
.append("fileType", getFileType())
|
||||
.append("sortNum", getSortNum())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.shzg.project.worn.domain.dto;
|
||||
|
||||
public class AppraisalFileDTO
|
||||
{
|
||||
/** 文件名 */
|
||||
private String name;
|
||||
|
||||
/** 文件地址 */
|
||||
private String url;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUrl()
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url)
|
||||
{
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.shzg.project.worn.domain.dto;
|
||||
|
||||
public class FileUrlDTO
|
||||
{
|
||||
private String name;
|
||||
private String url;
|
||||
|
||||
public FileUrlDTO()
|
||||
{
|
||||
}
|
||||
|
||||
public FileUrlDTO(String name, String url)
|
||||
{
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUrl()
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url)
|
||||
{
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.shzg.project.worn.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WornOutboundUpdateDTO {
|
||||
private Long billId;
|
||||
private String billNo;
|
||||
private String billType;
|
||||
private String warehouseCode;
|
||||
private String warehouseName;
|
||||
private String areaCode;
|
||||
private String areaName;
|
||||
private String billRemark;
|
||||
private Date outboundTime;
|
||||
private String status;
|
||||
private Date createTime;
|
||||
|
||||
private List<WornInboundItemDTO> itemList;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.shzg.project.worn.domain.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WornScanCodeDTO
|
||||
{
|
||||
/**
|
||||
* 当前扫码的唯一码
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 前端已扫描的唯一码列表
|
||||
*/
|
||||
private List<Integer> existList;
|
||||
|
||||
public Integer getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<Integer> getExistList()
|
||||
{
|
||||
return existList;
|
||||
}
|
||||
|
||||
public void setExistList(List<Integer> existList)
|
||||
{
|
||||
this.existList = existList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.shzg.project.worn.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import java.util.Date;
|
||||
@Data
|
||||
public class WornTechnicalAppraisalSimpleDTO
|
||||
{
|
||||
private Long id;
|
||||
|
||||
private String appraisalNo;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String appraisalDesc;
|
||||
private String remark;
|
||||
|
||||
/** 🔥 改这里:多图对象 */
|
||||
private List<AppraisalFileDTO> fileUrlList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.shzg.project.worn.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.worn.domain.WornOutboundBill;
|
||||
|
||||
/**
|
||||
* 出库单据Mapper接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
public interface WornOutboundBillMapper
|
||||
{
|
||||
/**
|
||||
* 查询出库单据
|
||||
*
|
||||
* @param id 出库单据主键
|
||||
* @return 出库单据
|
||||
*/
|
||||
public WornOutboundBill selectWornOutboundBillById(Long id);
|
||||
|
||||
/**
|
||||
* 查询出库单据列表
|
||||
*
|
||||
* @param wornOutboundBill 出库单据
|
||||
* @return 出库单据集合
|
||||
*/
|
||||
public List<WornOutboundBill> selectWornOutboundBillList(WornOutboundBill wornOutboundBill);
|
||||
|
||||
/**
|
||||
* 新增出库单据
|
||||
*
|
||||
* @param wornOutboundBill 出库单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornOutboundBill(WornOutboundBill wornOutboundBill);
|
||||
|
||||
/**
|
||||
* 修改出库单据
|
||||
*
|
||||
* @param wornOutboundBill 出库单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornOutboundBill(WornOutboundBill wornOutboundBill);
|
||||
|
||||
/**
|
||||
* 删除出库单据
|
||||
*
|
||||
* @param id 出库单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornOutboundBillById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除出库单据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornOutboundBillByIds(Long[] ids);
|
||||
|
||||
WornOutboundBill selectWornOutboundBillByBillNo(String billNo);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.shzg.project.worn.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.worn.domain.WornOutboundItem;
|
||||
|
||||
/**
|
||||
* 出库单明细Mapper接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
public interface WornOutboundItemMapper
|
||||
{
|
||||
/**
|
||||
* 查询出库单明细
|
||||
*
|
||||
* @param id 出库单明细主键
|
||||
* @return 出库单明细
|
||||
*/
|
||||
public WornOutboundItem selectWornOutboundItemById(Long id);
|
||||
|
||||
/**
|
||||
* 查询出库单明细列表
|
||||
*
|
||||
* @param wornOutboundItem 出库单明细
|
||||
* @return 出库单明细集合
|
||||
*/
|
||||
public List<WornOutboundItem> selectWornOutboundItemList(WornOutboundItem wornOutboundItem);
|
||||
|
||||
/**
|
||||
* 新增出库单明细
|
||||
*
|
||||
* @param wornOutboundItem 出库单明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornOutboundItem(WornOutboundItem wornOutboundItem);
|
||||
|
||||
/**
|
||||
* 修改出库单明细
|
||||
*
|
||||
* @param wornOutboundItem 出库单明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornOutboundItem(WornOutboundItem wornOutboundItem);
|
||||
|
||||
/**
|
||||
* 删除出库单明细
|
||||
*
|
||||
* @param id 出库单明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornOutboundItemById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除出库单明细
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornOutboundItemByIds(Long[] ids);
|
||||
|
||||
|
||||
int countNotOutboundByBillId(Long billId);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.shzg.project.worn.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.worn.domain.WornTechnicalAppraisalFile;
|
||||
|
||||
/**
|
||||
* 技术鉴定附件Mapper接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
public interface WornTechnicalAppraisalFileMapper
|
||||
{
|
||||
/**
|
||||
* 查询技术鉴定附件
|
||||
*
|
||||
* @param id 技术鉴定附件主键
|
||||
* @return 技术鉴定附件
|
||||
*/
|
||||
public WornTechnicalAppraisalFile selectWornTechnicalAppraisalFileById(Long id);
|
||||
|
||||
/**
|
||||
* 查询技术鉴定附件列表
|
||||
*
|
||||
* @param wornTechnicalAppraisalFile 技术鉴定附件
|
||||
* @return 技术鉴定附件集合
|
||||
*/
|
||||
public List<WornTechnicalAppraisalFile> selectWornTechnicalAppraisalFileList(WornTechnicalAppraisalFile wornTechnicalAppraisalFile);
|
||||
|
||||
/**
|
||||
* 新增技术鉴定附件
|
||||
*
|
||||
* @param wornTechnicalAppraisalFile 技术鉴定附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornTechnicalAppraisalFile(WornTechnicalAppraisalFile wornTechnicalAppraisalFile);
|
||||
|
||||
/**
|
||||
* 修改技术鉴定附件
|
||||
*
|
||||
* @param wornTechnicalAppraisalFile 技术鉴定附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornTechnicalAppraisalFile(WornTechnicalAppraisalFile wornTechnicalAppraisalFile);
|
||||
|
||||
/**
|
||||
* 删除技术鉴定附件
|
||||
*
|
||||
* @param id 技术鉴定附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornTechnicalAppraisalFileById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除技术鉴定附件
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornTechnicalAppraisalFileByIds(Long[] ids);
|
||||
/**
|
||||
* 根据技术鉴定表ID查询附件列表
|
||||
*
|
||||
* @param appraisalId 技术鉴定表ID
|
||||
* @return 附件列表
|
||||
*/
|
||||
List<WornTechnicalAppraisalFile> selectWornTechnicalAppraisalFileByAppraisalId(Long appraisalId);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.shzg.project.worn.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.worn.domain.WornTechnicalAppraisal;
|
||||
|
||||
/**
|
||||
* 技术鉴定Mapper接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
public interface WornTechnicalAppraisalMapper
|
||||
{
|
||||
/**
|
||||
* 查询技术鉴定
|
||||
*
|
||||
* @param id 技术鉴定主键
|
||||
* @return 技术鉴定
|
||||
*/
|
||||
public WornTechnicalAppraisal selectWornTechnicalAppraisalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询技术鉴定列表
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定
|
||||
* @return 技术鉴定集合
|
||||
*/
|
||||
public List<WornTechnicalAppraisal> selectWornTechnicalAppraisalList(WornTechnicalAppraisal wornTechnicalAppraisal);
|
||||
|
||||
/**
|
||||
* 新增技术鉴定
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornTechnicalAppraisal(WornTechnicalAppraisal wornTechnicalAppraisal);
|
||||
|
||||
/**
|
||||
* 修改技术鉴定
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornTechnicalAppraisal(WornTechnicalAppraisal wornTechnicalAppraisal);
|
||||
|
||||
/**
|
||||
* 删除技术鉴定
|
||||
*
|
||||
* @param id 技术鉴定主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornTechnicalAppraisalById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除技术鉴定
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornTechnicalAppraisalByIds(Long[] ids);
|
||||
/**
|
||||
* 查询我上传的技术鉴定表列表
|
||||
*
|
||||
* @param wornTechnicalAppraisal 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
List<WornTechnicalAppraisal> selectMyTechnicalAppraisalList(WornTechnicalAppraisal wornTechnicalAppraisal);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.shzg.project.worn.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.worn.domain.WornOutboundBill;
|
||||
|
||||
/**
|
||||
* 出库单据Service接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
public interface IWornOutboundBillService
|
||||
{
|
||||
/**
|
||||
* 查询出库单据
|
||||
*
|
||||
* @param id 出库单据主键
|
||||
* @return 出库单据
|
||||
*/
|
||||
public WornOutboundBill selectWornOutboundBillById(Long id);
|
||||
|
||||
/**
|
||||
* 查询出库单据列表
|
||||
*
|
||||
* @param wornOutboundBill 出库单据
|
||||
* @return 出库单据集合
|
||||
*/
|
||||
public List<WornOutboundBill> selectWornOutboundBillList(WornOutboundBill wornOutboundBill);
|
||||
|
||||
/**
|
||||
* 新增出库单据
|
||||
*
|
||||
* @param wornOutboundBill 出库单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornOutboundBill(WornOutboundBill wornOutboundBill);
|
||||
|
||||
/**
|
||||
* 修改出库单据
|
||||
*
|
||||
* @param wornOutboundBill 出库单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornOutboundBill(WornOutboundBill wornOutboundBill);
|
||||
|
||||
/**
|
||||
* 批量删除出库单据
|
||||
*
|
||||
* @param ids 需要删除的出库单据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornOutboundBillByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除出库单据信息
|
||||
*
|
||||
* @param id 出库单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornOutboundBillById(Long id);
|
||||
/**
|
||||
* 完成出库
|
||||
*
|
||||
* @param wornOutboundBill 出库单
|
||||
* @return 结果
|
||||
*/
|
||||
int completeWornOutboundBill(WornOutboundBill wornOutboundBill);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.shzg.project.worn.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.worn.domain.WornOutboundItem;
|
||||
import com.shzg.project.worn.domain.dto.WornOutboundUpdateDTO;
|
||||
|
||||
/**
|
||||
* 出库单明细Service接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
public interface IWornOutboundItemService
|
||||
{
|
||||
/**
|
||||
* 查询出库单明细
|
||||
*
|
||||
* @param id 出库单明细主键
|
||||
* @return 出库单明细
|
||||
*/
|
||||
public WornOutboundItem selectWornOutboundItemById(Long id);
|
||||
|
||||
/**
|
||||
* 查询出库单明细列表
|
||||
*
|
||||
* @param wornOutboundItem 出库单明细
|
||||
* @return 出库单明细集合
|
||||
*/
|
||||
public List<WornOutboundItem> selectWornOutboundItemList(WornOutboundItem wornOutboundItem);
|
||||
|
||||
/**
|
||||
* 新增出库单明细
|
||||
*
|
||||
* @param wornOutboundItem 出库单明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornOutboundItem(WornOutboundItem wornOutboundItem);
|
||||
|
||||
/**
|
||||
* 修改出库单明细
|
||||
*
|
||||
* @param dto 出库单明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornOutboundItem(WornOutboundUpdateDTO dto);
|
||||
|
||||
/**
|
||||
* 批量删除出库单明细
|
||||
*
|
||||
* @param ids 需要删除的出库单明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornOutboundItemByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除出库单明细信息
|
||||
*
|
||||
* @param id 出库单明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornOutboundItemById(Long id);
|
||||
/**
|
||||
* 根据出库单号查询出库单明细
|
||||
*
|
||||
* @param wornOutboundItem 出库单明细参数
|
||||
* @return 出库单详情
|
||||
*/
|
||||
WornOutboundUpdateDTO selectWornOutboundItemByBillNo(WornOutboundItem wornOutboundItem);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.shzg.project.worn.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.worn.domain.WornTechnicalAppraisalFile;
|
||||
import com.shzg.project.worn.domain.dto.FileUrlDTO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 技术鉴定附件Service接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
public interface IWornTechnicalAppraisalFileService
|
||||
{
|
||||
/**
|
||||
* 查询技术鉴定附件
|
||||
*
|
||||
* @param id 技术鉴定附件主键
|
||||
* @return 技术鉴定附件
|
||||
*/
|
||||
public WornTechnicalAppraisalFile selectWornTechnicalAppraisalFileById(Long id);
|
||||
|
||||
/**
|
||||
* 查询技术鉴定附件列表
|
||||
*
|
||||
* @param wornTechnicalAppraisalFile 技术鉴定附件
|
||||
* @return 技术鉴定附件集合
|
||||
*/
|
||||
public List<WornTechnicalAppraisalFile> selectWornTechnicalAppraisalFileList(WornTechnicalAppraisalFile wornTechnicalAppraisalFile);
|
||||
|
||||
/**
|
||||
* 新增技术鉴定附件
|
||||
*
|
||||
* @param wornTechnicalAppraisalFile 技术鉴定附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornTechnicalAppraisalFile(WornTechnicalAppraisalFile wornTechnicalAppraisalFile);
|
||||
|
||||
/**
|
||||
* 修改技术鉴定附件
|
||||
*
|
||||
* @param wornTechnicalAppraisalFile 技术鉴定附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornTechnicalAppraisalFile(WornTechnicalAppraisalFile wornTechnicalAppraisalFile);
|
||||
|
||||
/**
|
||||
* 批量删除技术鉴定附件
|
||||
*
|
||||
* @param ids 需要删除的技术鉴定附件主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornTechnicalAppraisalFileByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除技术鉴定附件信息
|
||||
*
|
||||
* @param id 技术鉴定附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornTechnicalAppraisalFileById(Long id);
|
||||
/**
|
||||
* 上传技术鉴定表附件
|
||||
* 只返回URL,不入库
|
||||
*
|
||||
* @param files 文件数组
|
||||
* @param request request
|
||||
* @return 文件访问URL列表
|
||||
*/
|
||||
List<FileUrlDTO> uploadBatch(MultipartFile[] files, String scene, String bizType, HttpServletRequest request);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.shzg.project.worn.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.shzg.framework.web.page.TableDataInfo;
|
||||
import com.shzg.project.worn.domain.WornTechnicalAppraisal;
|
||||
import com.shzg.project.worn.domain.dto.WornTechnicalAppraisalSimpleDTO;
|
||||
|
||||
/**
|
||||
* 技术鉴定Service接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
public interface IWornTechnicalAppraisalService
|
||||
{
|
||||
/**
|
||||
* 查询技术鉴定
|
||||
*
|
||||
* @param id 技术鉴定主键
|
||||
* @return 技术鉴定
|
||||
*/
|
||||
public WornTechnicalAppraisal selectWornTechnicalAppraisalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询技术鉴定列表
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定
|
||||
* @return 技术鉴定集合
|
||||
*/
|
||||
public List<WornTechnicalAppraisal> selectWornTechnicalAppraisalList(WornTechnicalAppraisal wornTechnicalAppraisal);
|
||||
|
||||
/**
|
||||
* 新增技术鉴定
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornTechnicalAppraisal(WornTechnicalAppraisal wornTechnicalAppraisal);
|
||||
|
||||
/**
|
||||
* 修改技术鉴定
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornTechnicalAppraisal(WornTechnicalAppraisal wornTechnicalAppraisal);
|
||||
|
||||
/**
|
||||
* 批量删除技术鉴定
|
||||
*
|
||||
* @param ids 需要删除的技术鉴定主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornTechnicalAppraisalByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除技术鉴定信息
|
||||
*
|
||||
* @param id 技术鉴定主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornTechnicalAppraisalById(Long id);
|
||||
/**
|
||||
* 新增技术鉴定表(含附件)
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定表
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWornTechnicalAppraisalWithFiles(WornTechnicalAppraisal wornTechnicalAppraisal);
|
||||
/**
|
||||
* 查询我上传的技术鉴定表列表
|
||||
*
|
||||
* @return 技术鉴定表列表
|
||||
*/
|
||||
TableDataInfo selectMyTechnicalAppraisalSimplePageList();
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import com.shzg.project.unique.domain.WornUniqueCode;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeEvent;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeEventMapper;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeMapper;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeMaterialMapper;
|
||||
import com.shzg.project.worn.domain.WornInboundItem;
|
||||
import com.shzg.project.worn.domain.dto.WornInboundPartialFinishDTO;
|
||||
import com.shzg.project.worn.domain.dto.WornInboundPartialFinishItemDTO;
|
||||
@@ -71,6 +72,9 @@ public class WornInboundBillServiceImpl implements IWornInboundBillService
|
||||
@Value("${worn.pdf-font-locations:classpath:fonts/simhei.ttf,/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc,/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc,/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc,/usr/share/fonts/truetype/arphic/ukai.ttc,C:/Windows/Fonts/simhei.ttf,C:/Windows/Fonts/simsun.ttc}")
|
||||
private String pdfFontLocations;
|
||||
|
||||
@Autowired
|
||||
private WornUniqueCodeMaterialMapper wornUniqueCodeMaterialMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询入库库存
|
||||
@@ -118,7 +122,9 @@ public class WornInboundBillServiceImpl implements IWornInboundBillService
|
||||
|
||||
/* ================== 2. 当前用户 ================== */
|
||||
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
|
||||
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
|
||||
|
||||
wornInboundBill.setProjectId(deptId);
|
||||
/* ================== 3. 主表赋值 ================== */
|
||||
wornInboundBill.setCreateTime(DateUtils.getNowDate());
|
||||
wornInboundBill.setCreateBy(String.valueOf(userId));
|
||||
@@ -444,14 +450,12 @@ public class WornInboundBillServiceImpl implements IWornInboundBillService
|
||||
updateItem.setUpdateTime(now);
|
||||
|
||||
int itemRows = wornInboundItemMapper.updateItemToVoid(updateItem);
|
||||
if (itemRows <= 0)
|
||||
{
|
||||
if (itemRows <= 0){
|
||||
throw new RuntimeException("明细作废失败,ID=" + item.getId());
|
||||
}
|
||||
|
||||
// 2.2 唯一码作废
|
||||
if (item.getUniqueCode() != null)
|
||||
{
|
||||
if (item.getUniqueCode() != null){
|
||||
WornUniqueCode unique = wornUniqueCodeMapper.selectByCode(item.getUniqueCode());
|
||||
if (unique != null)
|
||||
{
|
||||
@@ -467,8 +471,16 @@ public class WornInboundBillServiceImpl implements IWornInboundBillService
|
||||
{
|
||||
throw new RuntimeException("唯一码作废失败:" + item.getUniqueCode());
|
||||
}
|
||||
|
||||
// 🔥 写事件(9=作废)
|
||||
/* ================== 3.3 更新 material 为删除 ================== */
|
||||
WornUniqueCode wornUniqueCode = new WornUniqueCode();
|
||||
wornUniqueCode.setCode(item.getUniqueCode());
|
||||
List<WornUniqueCode> list = wornUniqueCodeMapper.selectWornUniqueCodeList(wornUniqueCode);
|
||||
if (list != null && list.size() > 0){
|
||||
//一个唯一码只有一条
|
||||
Long uniqueCodeId = list.get(0).getId();
|
||||
int uniqueRow = wornUniqueCodeMaterialMapper.updateDeleteByUniqueCodeId(uniqueCodeId);
|
||||
}
|
||||
/* ================== 3.3 写事件(9=作废) ================== */
|
||||
WornUniqueCodeEvent event = new WornUniqueCodeEvent();
|
||||
event.setUniqueCodeId(unique.getId());
|
||||
event.setEventType("9"); // 作废事件
|
||||
|
||||
@@ -8,8 +8,10 @@ import com.shzg.common.utils.SecurityUtils;
|
||||
import com.shzg.common.utils.StringUtils;
|
||||
import com.shzg.project.unique.domain.WornUniqueCode;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeEvent;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeMaterial;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeEventMapper;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeMapper;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeMaterialMapper;
|
||||
import com.shzg.project.worn.domain.WornInboundBill;
|
||||
import com.shzg.project.worn.domain.WornMaterial;
|
||||
import com.shzg.project.worn.domain.dto.WornInboundItemDTO;
|
||||
@@ -42,6 +44,8 @@ public class WornInboundItemServiceImpl implements IWornInboundItemService
|
||||
private WornUniqueCodeEventMapper eventMapper;
|
||||
@Autowired
|
||||
private WornInboundBillMapper wornInboundBillMapper;
|
||||
@Autowired
|
||||
private WornUniqueCodeMaterialMapper wornUniqueCodeMaterialMapper;
|
||||
/**
|
||||
* 查询入库单明细
|
||||
*
|
||||
@@ -176,6 +180,7 @@ public class WornInboundItemServiceImpl implements IWornInboundItemService
|
||||
throw new RuntimeException("入库单更新失败");
|
||||
}
|
||||
|
||||
WornInboundBill billUp = wornInboundBillMapper.selectWornInboundBillByBillNo(dto.getBillNo());
|
||||
// 2. 更新 / 新增 / 删除明细
|
||||
if (dto.getItemList() != null && !dto.getItemList().isEmpty()){
|
||||
for (WornInboundItemDTO itemDTO : dto.getItemList()){
|
||||
@@ -208,7 +213,7 @@ public class WornInboundItemServiceImpl implements IWornInboundItemService
|
||||
// 新增
|
||||
if (itemDTO.getId() == null){
|
||||
WornInboundItem newItem = new WornInboundItem();
|
||||
newItem.setBillId(dto.getBillId());
|
||||
newItem.setBillId(billUp.getId());
|
||||
newItem.setBillNo(dto.getBillNo());
|
||||
newItem.setMaterialId(itemDTO.getMaterialId());
|
||||
newItem.setQuantity(itemDTO.getQuantity());
|
||||
@@ -251,7 +256,19 @@ public class WornInboundItemServiceImpl implements IWornInboundItemService
|
||||
{
|
||||
throw new RuntimeException("入库明细更新失败");
|
||||
}
|
||||
|
||||
//唯一码物料表更改
|
||||
WornUniqueCode wornUniqueCode = new WornUniqueCode();
|
||||
wornUniqueCode.setCode(oldCode);
|
||||
List<WornUniqueCode> list = wornUniqueCodeMapper.selectWornUniqueCodeList(wornUniqueCode);
|
||||
if (list != null && list.size() > 0){
|
||||
//一个唯一码只有一条
|
||||
Long uniqueCodeId = list.get(0).getId();
|
||||
WornUniqueCodeMaterial wornUniqueCodeMaterial = new WornUniqueCodeMaterial();
|
||||
wornUniqueCodeMaterial.setUniqueCodeId(uniqueCodeId);
|
||||
wornUniqueCodeMaterial.setQuantity(itemDTO.getQuantity());
|
||||
wornUniqueCodeMaterial.setRemark(itemDTO.getRemark());
|
||||
int uniqueRow = wornUniqueCodeMaterialMapper.updateWornUniqueCodeMaterial(wornUniqueCodeMaterial);
|
||||
}
|
||||
// 唯一码变更处理
|
||||
if (oldCode != null && !oldCode.equals(newCode)){
|
||||
rollbackUniqueCode(userId, oldCode, now);
|
||||
|
||||
@@ -0,0 +1,375 @@
|
||||
package com.shzg.project.worn.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.shzg.common.utils.DateUtils;
|
||||
import com.shzg.common.utils.SecurityUtils;
|
||||
import com.shzg.common.utils.StringUtils;
|
||||
import com.shzg.project.unique.domain.WornUniqueCode;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeEvent;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeMaterial;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeEventMapper;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeMapper;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeMaterialMapper;
|
||||
import com.shzg.project.worn.domain.WornOutboundItem;
|
||||
import com.shzg.project.worn.mapper.WornOutboundItemMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.shzg.project.worn.mapper.WornOutboundBillMapper;
|
||||
import com.shzg.project.worn.domain.WornOutboundBill;
|
||||
import com.shzg.project.worn.service.IWornOutboundBillService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 出库单据Service业务层处理
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
@Service
|
||||
public class WornOutboundBillServiceImpl implements IWornOutboundBillService
|
||||
{
|
||||
@Autowired
|
||||
private WornOutboundBillMapper wornOutboundBillMapper;
|
||||
@Autowired
|
||||
private WornOutboundItemMapper wornOutboundItemMapper;
|
||||
@Autowired
|
||||
private WornUniqueCodeMapper wornUniqueCodeMapper;
|
||||
|
||||
@Autowired
|
||||
private WornUniqueCodeEventMapper eventMapper;
|
||||
|
||||
@Autowired
|
||||
private WornUniqueCodeMaterialMapper wornUniqueCodeMaterialMapper;
|
||||
/**
|
||||
* 查询出库单据
|
||||
*
|
||||
* @param id 出库单据主键
|
||||
* @return 出库单据
|
||||
*/
|
||||
@Override
|
||||
public WornOutboundBill selectWornOutboundBillById(Long id)
|
||||
{
|
||||
return wornOutboundBillMapper.selectWornOutboundBillById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库单据列表
|
||||
*
|
||||
* @param wornOutboundBill 出库单据
|
||||
* @return 出库单据
|
||||
*/
|
||||
@Override
|
||||
public List<WornOutboundBill> selectWornOutboundBillList(WornOutboundBill wornOutboundBill)
|
||||
{
|
||||
return wornOutboundBillMapper.selectWornOutboundBillList(wornOutboundBill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库单据
|
||||
*
|
||||
* @param wornOutboundBill 出库单据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertWornOutboundBill(WornOutboundBill wornOutboundBill){
|
||||
/* ================== 1. 参数校验 ================== */
|
||||
if (wornOutboundBill == null)
|
||||
{
|
||||
throw new RuntimeException("出库单参数不能为空");
|
||||
}
|
||||
if (wornOutboundBill.getItemList() == null || wornOutboundBill.getItemList().isEmpty())
|
||||
{
|
||||
throw new RuntimeException("出库明细不能为空");
|
||||
}
|
||||
|
||||
/* ================== 2. 当前用户 ================== */
|
||||
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
|
||||
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
|
||||
|
||||
wornOutboundBill.setProjectId(deptId);
|
||||
|
||||
/* ================== 3. 主表赋值 ================== */
|
||||
wornOutboundBill.setCreateTime(DateUtils.getNowDate());
|
||||
wornOutboundBill.setCreateBy(String.valueOf(userId));
|
||||
wornOutboundBill.setBillType("0");
|
||||
wornOutboundBill.setStatus("0");
|
||||
wornOutboundBill.setIsDelete("0");
|
||||
|
||||
if (wornOutboundBill.getBillNo() == null || "".equals(wornOutboundBill.getBillNo().trim()))
|
||||
{
|
||||
wornOutboundBill.setBillNo("DL" + System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/* ================== 4. 插入主表 ================== */
|
||||
int rows = wornOutboundBillMapper.insertWornOutboundBill(wornOutboundBill);
|
||||
if (rows <= 0)
|
||||
{
|
||||
throw new RuntimeException("出库单新增失败");
|
||||
}
|
||||
|
||||
Long billId = wornOutboundBill.getId();
|
||||
String billNo = wornOutboundBill.getBillNo();
|
||||
|
||||
if (billId == null)
|
||||
{
|
||||
throw new RuntimeException("出库单新增失败,ID未回填");
|
||||
}
|
||||
|
||||
/* ================== 5. 插入明细 ================== */
|
||||
for (WornOutboundItem item : wornOutboundBill.getItemList())
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
item.setBillId(billId);
|
||||
item.setBillNo(billNo);
|
||||
item.setCreateTime(DateUtils.getNowDate());
|
||||
item.setCreateBy(String.valueOf(userId));
|
||||
item.setIsDelete(item.getIsDelete());
|
||||
|
||||
int itemRows = wornOutboundItemMapper.insertWornOutboundItem(item);
|
||||
if (itemRows <= 0)
|
||||
{
|
||||
throw new RuntimeException("出库明细新增失败");
|
||||
}
|
||||
|
||||
/* ================== 6. 唯一码联动 ================== */
|
||||
if (item.getUniqueCode() != null)
|
||||
{
|
||||
Integer code = item.getUniqueCode();
|
||||
|
||||
Long uniqueId = wornUniqueCodeMapper.selectIdByCode(code);
|
||||
if (uniqueId == null)
|
||||
{
|
||||
throw new RuntimeException("唯一码不存在:" + code);
|
||||
}
|
||||
|
||||
WornUniqueCode unique = wornUniqueCodeMapper.selectByCode(code);
|
||||
|
||||
// ❗必须是“已入库状态(2)”才能出库
|
||||
if (!"2".equals(unique.getStatus())){
|
||||
throw new RuntimeException("唯一码[" + code + "]未入库,不能出库");
|
||||
}
|
||||
|
||||
/* ===== 状态更新:2 → 3(出库申请) ===== */
|
||||
WornUniqueCode update = new WornUniqueCode();
|
||||
update.setCode(code);
|
||||
update.setStatus("3"); // ⭐已出库
|
||||
update.setUpdateBy(String.valueOf(userId));
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
|
||||
int updateRows = wornUniqueCodeMapper.updateByCode(update);
|
||||
if (updateRows <= 0)
|
||||
{
|
||||
throw new RuntimeException("唯一码状态更新失败:" + code);
|
||||
}
|
||||
|
||||
/* ================== 7. 插入事件 ================== */
|
||||
WornUniqueCodeEvent event = new WornUniqueCodeEvent();
|
||||
event.setUniqueCodeId(uniqueId);
|
||||
event.setEventType("3"); // ⭐生成出库单
|
||||
event.setEventStatus("3"); // ⭐完成出库
|
||||
event.setEventDesc("生成出库单:" + billNo);
|
||||
event.setOperatorId(userId);
|
||||
event.setOperatorName(SecurityUtils.getUsername());
|
||||
event.setCreateBy(String.valueOf(userId));
|
||||
event.setCreateTime(DateUtils.getNowDate());
|
||||
event.setIsDelete("0");
|
||||
|
||||
int eventRows = eventMapper.insertWornUniqueCodeEvent(event);
|
||||
if (eventRows <= 0)
|
||||
{
|
||||
throw new RuntimeException("唯一码事件记录失败:" + code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库单据
|
||||
*
|
||||
* @param wornOutboundBill 出库单据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWornOutboundBill(WornOutboundBill wornOutboundBill)
|
||||
{
|
||||
wornOutboundBill.setUpdateTime(DateUtils.getNowDate());
|
||||
return wornOutboundBillMapper.updateWornOutboundBill(wornOutboundBill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除出库单据
|
||||
*
|
||||
* @param ids 需要删除的出库单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornOutboundBillByIds(Long[] ids)
|
||||
{
|
||||
return wornOutboundBillMapper.deleteWornOutboundBillByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库单据信息
|
||||
*
|
||||
* @param id 出库单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornOutboundBillById(Long id)
|
||||
{
|
||||
return wornOutboundBillMapper.deleteWornOutboundBillById(id);
|
||||
}
|
||||
/**
|
||||
* 完成出库
|
||||
*
|
||||
* @param wornOutboundBill 出库单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int completeWornOutboundBill(WornOutboundBill wornOutboundBill)
|
||||
{
|
||||
/* ================== 1. 参数校验 ================== */
|
||||
if (wornOutboundBill == null)
|
||||
{
|
||||
throw new RuntimeException("出库单参数不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(wornOutboundBill.getBillNo()))
|
||||
{
|
||||
throw new RuntimeException("出库单号不能为空");
|
||||
}
|
||||
|
||||
/* ================== 2. 当前用户 ================== */
|
||||
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
|
||||
Date now = DateUtils.getNowDate();
|
||||
|
||||
/* ================== 3. 查询出库单 ================== */
|
||||
WornOutboundBill dbBill = wornOutboundBillMapper.selectWornOutboundBillByBillNo(wornOutboundBill.getBillNo());
|
||||
if (dbBill == null)
|
||||
{
|
||||
throw new RuntimeException("出库单不存在:" + wornOutboundBill.getBillNo());
|
||||
}
|
||||
|
||||
/* ================== 4. 查询出库明细 ================== */
|
||||
WornOutboundItem param = new WornOutboundItem();
|
||||
param.setBillNo(wornOutboundBill.getBillNo());
|
||||
|
||||
List<WornOutboundItem> itemList = wornOutboundItemMapper.selectWornOutboundItemList(param);
|
||||
if (itemList == null || itemList.isEmpty())
|
||||
{
|
||||
throw new RuntimeException("出库明细不能为空");
|
||||
}
|
||||
|
||||
/* ================== 5. 循环处理每个唯一码 ================== */
|
||||
for (WornOutboundItem item : itemList)
|
||||
{
|
||||
if (item == null){
|
||||
continue;
|
||||
}
|
||||
if ("1".equals(item.getIsDelete())){
|
||||
continue;
|
||||
}
|
||||
if (item.getUniqueCode() == null){
|
||||
throw new RuntimeException("出库明细存在空唯一码");
|
||||
}
|
||||
|
||||
Integer code = item.getUniqueCode();
|
||||
|
||||
/* ===== 5.1 查询唯一码 ===== */
|
||||
WornUniqueCode uniqueCode = wornUniqueCodeMapper.selectByCode(code);
|
||||
if (uniqueCode == null){
|
||||
throw new RuntimeException("唯一码不存在:" + code);
|
||||
}
|
||||
|
||||
/* ===== 5.2 只有状态3才能完成出库 ===== */
|
||||
if (!"3".equals(uniqueCode.getStatus())){
|
||||
if ("2".equals(uniqueCode.getStatus())){
|
||||
throw new RuntimeException("唯一码[" + code + "]尚未生成出库单号,不能完成出库");
|
||||
}else if ("4".equals(uniqueCode.getStatus())){
|
||||
throw new RuntimeException("唯一码[" + code + "]已完成出库,请勿重复操作");
|
||||
}else if ("9".equals(uniqueCode.getStatus())){
|
||||
throw new RuntimeException("唯一码[" + code + "]已作废");
|
||||
}else{
|
||||
throw new RuntimeException("唯一码[" + code + "]当前状态不允许完成出库");
|
||||
}
|
||||
}
|
||||
|
||||
/* ===== 5.3 更新唯一码状态:3 -> 4 ===== */
|
||||
WornUniqueCode update = new WornUniqueCode();
|
||||
update.setCode(code);
|
||||
update.setStatus("4");
|
||||
update.setUpdateBy(String.valueOf(userId));
|
||||
update.setUpdateTime(now);
|
||||
|
||||
int updateRows = wornUniqueCodeMapper.updateByCode(update);
|
||||
if (updateRows <= 0){
|
||||
throw new RuntimeException("唯一码状态更新失败:" + code);
|
||||
}
|
||||
|
||||
/* ===== 5.4 同步更新唯一码物料表:逻辑删除 ===== */
|
||||
WornUniqueCodeMaterial codeMaterial = new WornUniqueCodeMaterial();
|
||||
codeMaterial.setUniqueCodeId(uniqueCode.getId());
|
||||
codeMaterial.setIsDelete("1");
|
||||
codeMaterial.setUpdateBy(String.valueOf(userId));
|
||||
codeMaterial.setUpdateTime(now);
|
||||
|
||||
int materialRows = wornUniqueCodeMaterialMapper.updateWornUniqueCodeMaterial(codeMaterial);
|
||||
if (materialRows <= 0){
|
||||
throw new RuntimeException("唯一码物料信息更新失败:" + code);
|
||||
}
|
||||
|
||||
/* ===== 5.5 写事件记录 ===== */
|
||||
WornUniqueCodeEvent event = new WornUniqueCodeEvent();
|
||||
event.setUniqueCodeId(uniqueCode.getId());
|
||||
event.setEventType("4");
|
||||
event.setEventStatus("4");
|
||||
event.setEventDesc("完成出库,出库单号:" + dbBill.getBillNo());
|
||||
event.setOperatorId(userId);
|
||||
event.setOperatorName(SecurityUtils.getUsername());
|
||||
event.setCreateBy(String.valueOf(userId));
|
||||
event.setCreateTime(now);
|
||||
event.setIsDelete("0");
|
||||
|
||||
int eventRows = eventMapper.insertWornUniqueCodeEvent(event);
|
||||
if (eventRows <= 0){
|
||||
throw new RuntimeException("唯一码事件记录失败:" + code);
|
||||
}
|
||||
}
|
||||
|
||||
/* ================== 6. 更新出库单状态 ================== */
|
||||
WornOutboundBill updateBill = new WornOutboundBill();
|
||||
updateBill.setBillNo(dbBill.getBillNo());
|
||||
updateBill.setUpdateBy(String.valueOf(userId));
|
||||
updateBill.setUpdateTime(now);
|
||||
// 4. 判断该单据下是否全部明细都已出库
|
||||
int notOutboundCount = wornOutboundItemMapper.countNotOutboundByBillId(dbBill.getId());
|
||||
if (notOutboundCount == 0)
|
||||
{
|
||||
// 全部出库
|
||||
updateBill.setStatus("1"); // 已完成
|
||||
updateBill.setBillType("1"); //
|
||||
}
|
||||
else
|
||||
{
|
||||
// 部分出库
|
||||
updateBill.setStatus("2"); // 部分出库
|
||||
// billType 可不改
|
||||
}
|
||||
|
||||
int billRows = wornOutboundBillMapper.updateWornOutboundBill(updateBill);
|
||||
if (billRows <= 0)
|
||||
{
|
||||
throw new RuntimeException("出库单状态更新失败");
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,427 @@
|
||||
package com.shzg.project.worn.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.shzg.common.utils.DateUtils;
|
||||
import com.shzg.common.utils.SecurityUtils;
|
||||
import com.shzg.common.utils.StringUtils;
|
||||
import com.shzg.project.unique.domain.WornUniqueCode;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeEvent;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeMaterial;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeEventMapper;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeMapper;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeMaterialMapper;
|
||||
import com.shzg.project.worn.domain.WornOutboundBill;
|
||||
import com.shzg.project.worn.domain.dto.WornInboundItemDTO;
|
||||
import com.shzg.project.worn.domain.dto.WornOutboundUpdateDTO;
|
||||
import com.shzg.project.worn.mapper.WornInboundBillMapper;
|
||||
import com.shzg.project.worn.mapper.WornOutboundBillMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.shzg.project.worn.mapper.WornOutboundItemMapper;
|
||||
import com.shzg.project.worn.domain.WornOutboundItem;
|
||||
import com.shzg.project.worn.service.IWornOutboundItemService;
|
||||
|
||||
/**
|
||||
* 出库单明细Service业务层处理
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-08
|
||||
*/
|
||||
@Service
|
||||
public class WornOutboundItemServiceImpl implements IWornOutboundItemService
|
||||
{
|
||||
@Autowired
|
||||
private WornOutboundItemMapper wornOutboundItemMapper;
|
||||
@Autowired
|
||||
private WornUniqueCodeMapper wornUniqueCodeMapper;
|
||||
@Autowired
|
||||
private WornUniqueCodeEventMapper eventMapper;
|
||||
@Autowired
|
||||
private WornInboundBillMapper wornInboundBillMapper;
|
||||
@Autowired
|
||||
private WornUniqueCodeMaterialMapper wornUniqueCodeMaterialMapper;
|
||||
@Autowired
|
||||
private WornOutboundBillMapper wornOutboundBillMapper;
|
||||
/**
|
||||
* 查询出库单明细
|
||||
*
|
||||
* @param id 出库单明细主键
|
||||
* @return 出库单明细
|
||||
*/
|
||||
@Override
|
||||
public WornOutboundItem selectWornOutboundItemById(Long id)
|
||||
{
|
||||
return wornOutboundItemMapper.selectWornOutboundItemById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库单明细列表
|
||||
*
|
||||
* @param wornOutboundItem 出库单明细
|
||||
* @return 出库单明细
|
||||
*/
|
||||
@Override
|
||||
public List<WornOutboundItem> selectWornOutboundItemList(WornOutboundItem wornOutboundItem)
|
||||
{
|
||||
return wornOutboundItemMapper.selectWornOutboundItemList(wornOutboundItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库单明细
|
||||
*
|
||||
* @param wornOutboundItem 出库单明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWornOutboundItem(WornOutboundItem wornOutboundItem)
|
||||
{
|
||||
wornOutboundItem.setCreateTime(DateUtils.getNowDate());
|
||||
return wornOutboundItemMapper.insertWornOutboundItem(wornOutboundItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库单明细
|
||||
*
|
||||
* @param dto 出库单明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWornOutboundItem(WornOutboundUpdateDTO dto)
|
||||
{
|
||||
if (dto == null){
|
||||
throw new RuntimeException("出库单参数不能为空");
|
||||
}
|
||||
|
||||
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
|
||||
Date now = DateUtils.getNowDate();
|
||||
|
||||
// 1. 更新主表
|
||||
WornOutboundBill bill = new WornOutboundBill();
|
||||
bill.setBillNo(dto.getBillNo());
|
||||
bill.setWarehouseCode(dto.getWarehouseCode());
|
||||
bill.setWarehouseName(dto.getWarehouseName());
|
||||
bill.setAreaCode(dto.getAreaCode());
|
||||
bill.setAreaName(dto.getAreaName());
|
||||
bill.setRemark(dto.getBillRemark());
|
||||
bill.setOutboundTime(dto.getOutboundTime());
|
||||
bill.setStatus("0");
|
||||
bill.setUpdateBy(String.valueOf(userId));
|
||||
bill.setUpdateTime(now);
|
||||
|
||||
int billRows = wornOutboundBillMapper.updateWornOutboundBill(bill);
|
||||
if (billRows <= 0){
|
||||
throw new RuntimeException("出库单更新失败");
|
||||
}
|
||||
|
||||
WornOutboundBill billUp = wornOutboundBillMapper.selectWornOutboundBillByBillNo(dto.getBillNo());
|
||||
if (billUp == null){
|
||||
throw new RuntimeException("出库单不存在:" + dto.getBillNo());
|
||||
}
|
||||
|
||||
// 2. 更新 / 新增 / 删除明细
|
||||
if (dto.getItemList() != null && !dto.getItemList().isEmpty()){
|
||||
for (WornInboundItemDTO itemDTO : dto.getItemList()){
|
||||
if (itemDTO == null){
|
||||
continue;
|
||||
}
|
||||
|
||||
// 删除
|
||||
if ("1".equals(itemDTO.getIsDelete())){
|
||||
if (itemDTO.getId() != null){
|
||||
WornOutboundItem oldItem = wornOutboundItemMapper.selectWornOutboundItemById(itemDTO.getId());
|
||||
if (oldItem != null){
|
||||
oldItem.setIsDelete("1");
|
||||
oldItem.setUpdateBy(String.valueOf(userId));
|
||||
oldItem.setUpdateTime(now);
|
||||
|
||||
int deleteRows = wornOutboundItemMapper.updateWornOutboundItem(oldItem);
|
||||
if (deleteRows <= 0){
|
||||
throw new RuntimeException("出库明细删除失败");
|
||||
}
|
||||
|
||||
if (oldItem.getUniqueCode() != null){
|
||||
rollbackUniqueCodeOut(userId, oldItem.getUniqueCode(), now);
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// 新增
|
||||
if (itemDTO.getId() == null){
|
||||
WornOutboundItem newItem = new WornOutboundItem();
|
||||
newItem.setBillId(billUp.getId());
|
||||
newItem.setBillNo(dto.getBillNo());
|
||||
newItem.setMaterialId(itemDTO.getMaterialId());
|
||||
newItem.setQuantity(itemDTO.getQuantity());
|
||||
newItem.setRemark(itemDTO.getRemark());
|
||||
newItem.setUniqueCode(itemDTO.getUniqueCode());
|
||||
newItem.setIsDelete("0");
|
||||
newItem.setCreateBy(String.valueOf(userId));
|
||||
newItem.setCreateTime(now);
|
||||
|
||||
int itemRows = wornOutboundItemMapper.insertWornOutboundItem(newItem);
|
||||
if (itemRows <= 0){
|
||||
throw new RuntimeException("出库明细新增失败");
|
||||
}
|
||||
|
||||
if (newItem.getUniqueCode() != null){
|
||||
handleUniqueCodeOut(userId, dto.getBillNo(), newItem.getUniqueCode(), now);
|
||||
}
|
||||
}else{
|
||||
// 更新
|
||||
WornOutboundItem oldItem = wornOutboundItemMapper.selectWornOutboundItemById(itemDTO.getId());
|
||||
if (oldItem == null)
|
||||
{
|
||||
throw new RuntimeException("出库明细不存在,ID:" + itemDTO.getId());
|
||||
}
|
||||
|
||||
Integer oldCode = oldItem.getUniqueCode();
|
||||
Integer newCode = itemDTO.getUniqueCode();
|
||||
|
||||
oldItem.setMaterialId(itemDTO.getMaterialId());
|
||||
oldItem.setQuantity(itemDTO.getQuantity());
|
||||
oldItem.setRemark(itemDTO.getRemark());
|
||||
oldItem.setUniqueCode(newCode);
|
||||
oldItem.setUpdateBy(String.valueOf(userId));
|
||||
oldItem.setUpdateTime(now);
|
||||
|
||||
int itemRows = wornOutboundItemMapper.updateWornOutboundItem(oldItem);
|
||||
if (itemRows <= 0)
|
||||
{
|
||||
throw new RuntimeException("出库明细更新失败");
|
||||
}
|
||||
|
||||
// 唯一码物料表更改(如果你出库也维护这个表,就保留;如果不维护可删掉)
|
||||
WornUniqueCode wornUniqueCode = new WornUniqueCode();
|
||||
wornUniqueCode.setCode(oldCode);
|
||||
List<WornUniqueCode> list = wornUniqueCodeMapper.selectWornUniqueCodeList(wornUniqueCode);
|
||||
if (list != null && list.size() > 0){
|
||||
Long uniqueCodeId = list.get(0).getId();
|
||||
WornUniqueCodeMaterial wornUniqueCodeMaterial = new WornUniqueCodeMaterial();
|
||||
wornUniqueCodeMaterial.setUniqueCodeId(uniqueCodeId);
|
||||
wornUniqueCodeMaterial.setQuantity(itemDTO.getQuantity());
|
||||
wornUniqueCodeMaterial.setRemark(itemDTO.getRemark());
|
||||
wornUniqueCodeMaterialMapper.updateWornUniqueCodeMaterial(wornUniqueCodeMaterial);
|
||||
}
|
||||
|
||||
// 唯一码变更处理
|
||||
if (oldCode != null && !oldCode.equals(newCode)){
|
||||
rollbackUniqueCodeOut(userId, oldCode, now);
|
||||
}
|
||||
if (newCode != null && !newCode.equals(oldCode)){
|
||||
handleUniqueCodeOut(userId, dto.getBillNo(), newCode, now);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除出库单明细
|
||||
*
|
||||
* @param ids 需要删除的出库单明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornOutboundItemByIds(Long[] ids)
|
||||
{
|
||||
return wornOutboundItemMapper.deleteWornOutboundItemByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库单明细信息
|
||||
*
|
||||
* @param id 出库单明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornOutboundItemById(Long id)
|
||||
{
|
||||
return wornOutboundItemMapper.deleteWornOutboundItemById(id);
|
||||
}
|
||||
/**
|
||||
* 查询出库单明细列表
|
||||
*
|
||||
* @param wornOutboundItem 出库单明细
|
||||
* @return 出库单明细
|
||||
*/
|
||||
@Override
|
||||
public WornOutboundUpdateDTO selectWornOutboundItemByBillNo(WornOutboundItem wornOutboundItem)
|
||||
{
|
||||
String billNo = wornOutboundItem.getBillNo();
|
||||
if (billNo == null || "".equals(billNo.trim()))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// 1. 查询明细列表
|
||||
WornOutboundItem param = new WornOutboundItem();
|
||||
param.setBillNo(billNo);
|
||||
|
||||
List<WornOutboundItem> itemList = wornOutboundItemMapper.selectWornOutboundItemList(param);
|
||||
|
||||
if (itemList == null || itemList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// 2. 取第一条作为主数据
|
||||
WornOutboundItem first = itemList.get(0);
|
||||
|
||||
// 3. 组装主表 DTO
|
||||
WornOutboundUpdateDTO dto = new WornOutboundUpdateDTO();
|
||||
dto.setBillId(first.getBillId());
|
||||
dto.setBillNo(first.getBillNo());
|
||||
dto.setBillType(first.getBillType());
|
||||
dto.setWarehouseCode(first.getWarehouseCode());
|
||||
dto.setWarehouseName(first.getWarehouseName());
|
||||
dto.setAreaCode(first.getAreaCode());
|
||||
dto.setAreaName(first.getAreaName());
|
||||
dto.setBillRemark(first.getBillRemark());
|
||||
dto.setOutboundTime(first.getOutboundTime());
|
||||
dto.setStatus(first.getBillStatus());
|
||||
dto.setCreateTime(first.getCreateTime());
|
||||
|
||||
List<WornInboundItemDTO> dtoList = new ArrayList<>();
|
||||
|
||||
// 4. 组装明细
|
||||
for (WornOutboundItem item : itemList)
|
||||
{
|
||||
WornInboundItemDTO itemDTO = new WornInboundItemDTO();
|
||||
|
||||
itemDTO.setId(item.getId());
|
||||
itemDTO.setMaterialId(item.getMaterialId());
|
||||
itemDTO.setMaterialName(item.getMaterialName());
|
||||
itemDTO.setMaterialCode(item.getMaterialCode());
|
||||
itemDTO.setMaterialShortName(item.getMaterialShortName());
|
||||
itemDTO.setModel(item.getModel());
|
||||
itemDTO.setSpecification(item.getSpecification());
|
||||
itemDTO.setTypeName(item.getTypeName());
|
||||
itemDTO.setQuantity(item.getQuantity());
|
||||
itemDTO.setRemark(item.getRemark());
|
||||
itemDTO.setUniqueCode(item.getUniqueCode());
|
||||
itemDTO.setIsDelete(StringUtils.isEmpty(item.getIsDelete()) ? "0" : item.getIsDelete());
|
||||
itemDTO.setTypeParentNames(item.getTypeParentNames());
|
||||
itemDTO.setUnitId(item.getUnitId());
|
||||
itemDTO.setUnitName(item.getUnitName());
|
||||
itemDTO.setStatus(item.getStatus());
|
||||
|
||||
dtoList.add(itemDTO);
|
||||
}
|
||||
|
||||
dto.setItemList(dtoList);
|
||||
|
||||
return dto;
|
||||
}
|
||||
/**
|
||||
* 出库明细删除/替换时,唯一码状态回滚:3 -> 2
|
||||
*/
|
||||
private void rollbackUniqueCodeOut(Long userId, Integer code, Date now)
|
||||
{
|
||||
if (code == null){
|
||||
return;
|
||||
}
|
||||
|
||||
WornUniqueCode uniqueCode = wornUniqueCodeMapper.selectByCode(code);
|
||||
if (uniqueCode == null){
|
||||
throw new RuntimeException("唯一码不存在:" + code);
|
||||
}
|
||||
|
||||
// 只有“生成出库单号”状态才回滚
|
||||
if (!"3".equals(uniqueCode.getStatus())){
|
||||
return;
|
||||
}
|
||||
|
||||
WornUniqueCode update = new WornUniqueCode();
|
||||
update.setCode(code);
|
||||
update.setBillNo(null);
|
||||
update.setStatus("2");
|
||||
update.setUpdateBy(String.valueOf(userId));
|
||||
update.setUpdateTime(now);
|
||||
|
||||
int updateRows = wornUniqueCodeMapper.updateByCode(update);
|
||||
if (updateRows <= 0)
|
||||
{
|
||||
throw new RuntimeException("唯一码状态回滚失败:" + code);
|
||||
}
|
||||
|
||||
Long uniqueId = wornUniqueCodeMapper.selectIdByCode(code);
|
||||
if (uniqueId != null){
|
||||
WornUniqueCodeEvent event = new WornUniqueCodeEvent();
|
||||
event.setUniqueCodeId(uniqueId);
|
||||
event.setEventType("2");
|
||||
event.setEventStatus("2");
|
||||
event.setEventDesc("出库单编辑回滚,恢复已入库状态");
|
||||
event.setOperatorId(userId);
|
||||
event.setOperatorName(SecurityUtils.getUsername());
|
||||
event.setCreateBy(String.valueOf(userId));
|
||||
event.setCreateTime(now);
|
||||
event.setIsDelete("0");
|
||||
|
||||
eventMapper.insertWornUniqueCodeEvent(event);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 出库申请时,唯一码状态处理:2 -> 3
|
||||
*/
|
||||
private void handleUniqueCodeOut(Long userId, String billNo, Integer code, Date now)
|
||||
{
|
||||
if (code == null){
|
||||
return;
|
||||
}
|
||||
|
||||
WornUniqueCode uniqueCode = wornUniqueCodeMapper.selectByCode(code);
|
||||
if (uniqueCode == null)
|
||||
{
|
||||
throw new RuntimeException("唯一码不存在:" + code);
|
||||
}
|
||||
|
||||
if (!"2".equals(uniqueCode.getStatus())) {
|
||||
if ("3".equals(uniqueCode.getStatus()))
|
||||
{
|
||||
throw new RuntimeException("唯一码已生成出库单号,请勿重复操作:" + code);
|
||||
}else if ("4".equals(uniqueCode.getStatus())){
|
||||
throw new RuntimeException("唯一码已完成出库:" + code);
|
||||
}else if ("9".equals(uniqueCode.getStatus())){
|
||||
throw new RuntimeException("唯一码已作废:" + code);
|
||||
}else{
|
||||
throw new RuntimeException("唯一码状态不允许出库:" + code);
|
||||
}
|
||||
}
|
||||
|
||||
WornUniqueCode update = new WornUniqueCode();
|
||||
update.setCode(code);
|
||||
update.setBillNo(billNo);
|
||||
update.setStatus("3");
|
||||
update.setUpdateBy(String.valueOf(userId));
|
||||
update.setUpdateTime(now);
|
||||
|
||||
int updateRows = wornUniqueCodeMapper.updateByCode(update);
|
||||
if (updateRows <= 0)
|
||||
{
|
||||
throw new RuntimeException("唯一码状态更新失败:" + code);
|
||||
}
|
||||
|
||||
Long uniqueId = wornUniqueCodeMapper.selectIdByCode(code);
|
||||
if (uniqueId != null)
|
||||
{
|
||||
WornUniqueCodeEvent event = new WornUniqueCodeEvent();
|
||||
event.setUniqueCodeId(uniqueId);
|
||||
event.setEventType("3");
|
||||
event.setEventStatus("3");
|
||||
event.setEventDesc("编辑出库单,生成出库单号:" + billNo);
|
||||
event.setOperatorId(userId);
|
||||
event.setOperatorName(SecurityUtils.getUsername());
|
||||
event.setCreateBy(String.valueOf(userId));
|
||||
event.setCreateTime(now);
|
||||
event.setIsDelete("0");
|
||||
|
||||
eventMapper.insertWornUniqueCodeEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
package com.shzg.project.worn.service.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
import com.shzg.common.utils.DateUtils;
|
||||
import com.shzg.common.utils.StringUtils;
|
||||
import com.shzg.project.worn.domain.FileUploadConfig;
|
||||
import com.shzg.project.worn.domain.dto.FileUrlDTO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.shzg.project.worn.mapper.WornTechnicalAppraisalFileMapper;
|
||||
import com.shzg.project.worn.domain.WornTechnicalAppraisalFile;
|
||||
import com.shzg.project.worn.service.IWornTechnicalAppraisalFileService;
|
||||
import com.shzg.common.exception.ServiceException;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
* 技术鉴定附件Service业务层处理
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
@Service
|
||||
public class WornTechnicalAppraisalFileServiceImpl implements IWornTechnicalAppraisalFileService
|
||||
{
|
||||
@Autowired
|
||||
private WornTechnicalAppraisalFileMapper wornTechnicalAppraisalFileMapper;
|
||||
|
||||
@Autowired
|
||||
private FileUploadConfig fileUploadConfig;
|
||||
/**
|
||||
* 查询技术鉴定附件
|
||||
*
|
||||
* @param id 技术鉴定附件主键
|
||||
* @return 技术鉴定附件
|
||||
*/
|
||||
@Override
|
||||
public WornTechnicalAppraisalFile selectWornTechnicalAppraisalFileById(Long id)
|
||||
{
|
||||
return wornTechnicalAppraisalFileMapper.selectWornTechnicalAppraisalFileById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询技术鉴定附件列表
|
||||
*
|
||||
* @param wornTechnicalAppraisalFile 技术鉴定附件
|
||||
* @return 技术鉴定附件
|
||||
*/
|
||||
@Override
|
||||
public List<WornTechnicalAppraisalFile> selectWornTechnicalAppraisalFileList(WornTechnicalAppraisalFile wornTechnicalAppraisalFile)
|
||||
{
|
||||
return wornTechnicalAppraisalFileMapper.selectWornTechnicalAppraisalFileList(wornTechnicalAppraisalFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增技术鉴定附件
|
||||
*
|
||||
* @param wornTechnicalAppraisalFile 技术鉴定附件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWornTechnicalAppraisalFile(WornTechnicalAppraisalFile wornTechnicalAppraisalFile)
|
||||
{
|
||||
wornTechnicalAppraisalFile.setCreateTime(DateUtils.getNowDate());
|
||||
return wornTechnicalAppraisalFileMapper.insertWornTechnicalAppraisalFile(wornTechnicalAppraisalFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改技术鉴定附件
|
||||
*
|
||||
* @param wornTechnicalAppraisalFile 技术鉴定附件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWornTechnicalAppraisalFile(WornTechnicalAppraisalFile wornTechnicalAppraisalFile)
|
||||
{
|
||||
return wornTechnicalAppraisalFileMapper.updateWornTechnicalAppraisalFile(wornTechnicalAppraisalFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除技术鉴定附件
|
||||
*
|
||||
* @param ids 需要删除的技术鉴定附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornTechnicalAppraisalFileByIds(Long[] ids)
|
||||
{
|
||||
return wornTechnicalAppraisalFileMapper.deleteWornTechnicalAppraisalFileByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除技术鉴定附件信息
|
||||
*
|
||||
* @param id 技术鉴定附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornTechnicalAppraisalFileById(Long id)
|
||||
{
|
||||
return wornTechnicalAppraisalFileMapper.deleteWornTechnicalAppraisalFileById(id);
|
||||
}
|
||||
private static final Logger log = LoggerFactory.getLogger(WornTechnicalAppraisalFileServiceImpl.class);
|
||||
|
||||
/**
|
||||
* 上传技术鉴定附件存放子目录
|
||||
* 最终物理路径:profile + /technical_appraisal/yyyy/MM/dd/
|
||||
* 最终访问路径:/profile/technical_appraisal/yyyy/MM/dd/xxx.jpg
|
||||
*/
|
||||
private static final String BASE_PATH = "/technical_appraisal/";
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<FileUrlDTO> uploadBatch(MultipartFile[] files, String scene, String bizType, HttpServletRequest request)
|
||||
{
|
||||
if (files == null || files.length == 0)
|
||||
{
|
||||
throw new ServiceException("上传文件不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(scene) || StringUtils.isBlank(bizType))
|
||||
{
|
||||
throw new ServiceException("scene 和 bizType 不能为空");
|
||||
}
|
||||
|
||||
scene = scene.trim().toLowerCase(Locale.ROOT);
|
||||
bizType = bizType.trim().toLowerCase(Locale.ROOT);
|
||||
|
||||
String dateFolder = new SimpleDateFormat("yyyy/MM/dd").format(new Date());
|
||||
String uploadPath = fileUploadConfig.getUploadPath();
|
||||
|
||||
File dir = new File(uploadPath + "/" + scene + "/" + bizType + "/" + dateFolder);
|
||||
if (!dir.exists())
|
||||
{
|
||||
dir.mkdirs();
|
||||
}
|
||||
|
||||
List<FileUrlDTO> result = new ArrayList<>();
|
||||
|
||||
try
|
||||
{
|
||||
log.info("进入批量上传接口,scene={}, bizType={}, fileCount={}", scene, bizType, files.length);
|
||||
|
||||
for (MultipartFile file : files)
|
||||
{
|
||||
if (file == null || file.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
log.info("========== 上传文件信息 ==========");
|
||||
log.info("originalFilename = {}", file.getOriginalFilename());
|
||||
log.info("contentType = {}", file.getContentType());
|
||||
log.info("size(bytes) = {}", file.getSize());
|
||||
log.info("=================================");
|
||||
|
||||
String contentType = file.getContentType();
|
||||
if (contentType == null || !contentType.startsWith("image/"))
|
||||
{
|
||||
throw new ServiceException("上传失败:只允许上传图片文件");
|
||||
}
|
||||
|
||||
String original = file.getOriginalFilename();
|
||||
String ext = "";
|
||||
|
||||
if (original != null && original.contains("."))
|
||||
{
|
||||
ext = original.substring(original.lastIndexOf("."));
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(ext))
|
||||
{
|
||||
if ("image/jpeg".equals(contentType))
|
||||
{
|
||||
ext = ".jpg";
|
||||
}
|
||||
else if ("image/png".equals(contentType))
|
||||
{
|
||||
ext = ".png";
|
||||
}
|
||||
else if ("image/gif".equals(contentType))
|
||||
{
|
||||
ext = ".gif";
|
||||
}
|
||||
else if ("image/webp".equals(contentType))
|
||||
{
|
||||
ext = ".webp";
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ServiceException("无法识别图片类型");
|
||||
}
|
||||
}
|
||||
|
||||
String newName = UUID.randomUUID().toString().replace("-", "") + ext;
|
||||
|
||||
File targetFile = new File(dir, newName);
|
||||
file.transferTo(targetFile);
|
||||
|
||||
String baseUrl = ServletUriComponentsBuilder.fromRequestUri(request)
|
||||
.replacePath(null)
|
||||
.build()
|
||||
.toUriString();
|
||||
|
||||
String url = baseUrl + "/profile/" + scene + "/" + bizType + "/" + dateFolder + "/" + newName;
|
||||
|
||||
FileUrlDTO dto = new FileUrlDTO();
|
||||
dto.setName(newName);
|
||||
dto.setUrl(url);
|
||||
result.add(dto);
|
||||
}
|
||||
|
||||
log.info("批量上传成功,result={}", result);
|
||||
return result;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("批量上传失败", e);
|
||||
throw new ServiceException("文件上传失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
package com.shzg.project.worn.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.shzg.common.utils.DateUtils;
|
||||
import com.shzg.common.utils.SecurityUtils;
|
||||
import com.shzg.common.utils.StringUtils;
|
||||
import com.shzg.framework.web.page.TableDataInfo;
|
||||
import com.shzg.project.worn.domain.WornOutboundBill;
|
||||
import com.shzg.project.worn.domain.WornTechnicalAppraisalFile;
|
||||
import com.shzg.project.worn.domain.dto.AppraisalFileDTO;
|
||||
import com.shzg.project.worn.domain.dto.WornTechnicalAppraisalSimpleDTO;
|
||||
import com.shzg.project.worn.mapper.WornOutboundBillMapper;
|
||||
import com.shzg.project.worn.mapper.WornTechnicalAppraisalFileMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.shzg.project.worn.mapper.WornTechnicalAppraisalMapper;
|
||||
import com.shzg.project.worn.domain.WornTechnicalAppraisal;
|
||||
import com.shzg.project.worn.service.IWornTechnicalAppraisalService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 技术鉴定Service业务层处理
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-04-10
|
||||
*/
|
||||
@Service
|
||||
public class WornTechnicalAppraisalServiceImpl implements IWornTechnicalAppraisalService
|
||||
{
|
||||
@Autowired
|
||||
private WornTechnicalAppraisalMapper wornTechnicalAppraisalMapper;
|
||||
@Autowired
|
||||
private WornOutboundBillMapper wornOutboundBillMapper;
|
||||
@Autowired
|
||||
private WornTechnicalAppraisalFileMapper wornTechnicalAppraisalFileMapper;
|
||||
/**
|
||||
* 查询技术鉴定
|
||||
*
|
||||
* @param id 技术鉴定主键
|
||||
* @return 技术鉴定
|
||||
*/
|
||||
@Override
|
||||
public WornTechnicalAppraisal selectWornTechnicalAppraisalById(Long id)
|
||||
{
|
||||
return wornTechnicalAppraisalMapper.selectWornTechnicalAppraisalById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询技术鉴定列表
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定
|
||||
* @return 技术鉴定
|
||||
*/
|
||||
@Override
|
||||
public List<WornTechnicalAppraisal> selectWornTechnicalAppraisalList(WornTechnicalAppraisal wornTechnicalAppraisal)
|
||||
{
|
||||
return wornTechnicalAppraisalMapper.selectWornTechnicalAppraisalList(wornTechnicalAppraisal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增技术鉴定
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWornTechnicalAppraisal(WornTechnicalAppraisal wornTechnicalAppraisal)
|
||||
{
|
||||
wornTechnicalAppraisal.setCreateTime(DateUtils.getNowDate());
|
||||
return wornTechnicalAppraisalMapper.insertWornTechnicalAppraisal(wornTechnicalAppraisal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改技术鉴定
|
||||
*
|
||||
* @param wornTechnicalAppraisal 技术鉴定
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWornTechnicalAppraisal(WornTechnicalAppraisal wornTechnicalAppraisal)
|
||||
{
|
||||
wornTechnicalAppraisal.setUpdateTime(DateUtils.getNowDate());
|
||||
return wornTechnicalAppraisalMapper.updateWornTechnicalAppraisal(wornTechnicalAppraisal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除技术鉴定
|
||||
*
|
||||
* @param ids 需要删除的技术鉴定主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornTechnicalAppraisalByIds(Long[] ids)
|
||||
{
|
||||
return wornTechnicalAppraisalMapper.deleteWornTechnicalAppraisalByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除技术鉴定信息
|
||||
*
|
||||
* @param id 技术鉴定主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornTechnicalAppraisalById(Long id)
|
||||
{
|
||||
return wornTechnicalAppraisalMapper.deleteWornTechnicalAppraisalById(id);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertWornTechnicalAppraisalWithFiles(WornTechnicalAppraisal wornTechnicalAppraisal)
|
||||
{
|
||||
/* ================== 1. 参数校验 ================== */
|
||||
if (wornTechnicalAppraisal == null)
|
||||
{
|
||||
throw new RuntimeException("技术鉴定表参数不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(wornTechnicalAppraisal.getBillNo()))
|
||||
{
|
||||
throw new RuntimeException("出库单号不能为空");
|
||||
}
|
||||
|
||||
/* ================== 2. 当前用户 ================== */
|
||||
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
|
||||
String userName = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
|
||||
Date now = DateUtils.getNowDate();
|
||||
|
||||
/* ================== 3. 校验一张出库单只能有一张技术鉴定表 ================== */
|
||||
WornTechnicalAppraisal query = new WornTechnicalAppraisal();
|
||||
query.setBillNo(wornTechnicalAppraisal.getBillNo());
|
||||
List<WornTechnicalAppraisal> oldList = wornTechnicalAppraisalMapper.selectWornTechnicalAppraisalList(query);
|
||||
if (oldList != null && !oldList.isEmpty())
|
||||
{
|
||||
throw new RuntimeException("该出库单已存在技术鉴定表,请勿重复新增");
|
||||
}
|
||||
|
||||
/* ================== 4. 查询出库单(可选,但建议保留) ================== */
|
||||
WornOutboundBill outboundBill = wornOutboundBillMapper.selectWornOutboundBillByBillNo(wornTechnicalAppraisal.getBillNo());
|
||||
if (outboundBill == null)
|
||||
{
|
||||
throw new RuntimeException("关联出库单不存在:" + wornTechnicalAppraisal.getBillNo());
|
||||
}
|
||||
|
||||
/* ================== 5. 主表赋值 ================== */
|
||||
if (StringUtils.isEmpty(wornTechnicalAppraisal.getAppraisalNo()))
|
||||
{
|
||||
wornTechnicalAppraisal.setAppraisalNo("TAR" + DateUtils.dateTimeNow("yyyyMMddHHmmssSSS"));
|
||||
}
|
||||
|
||||
wornTechnicalAppraisal.setBillId(outboundBill.getId());
|
||||
wornTechnicalAppraisal.setProjectId(deptId);
|
||||
wornTechnicalAppraisal.setUserId(userId);
|
||||
wornTechnicalAppraisal.setUserName(userName);
|
||||
wornTechnicalAppraisal.setStatus("1");
|
||||
wornTechnicalAppraisal.setCreateBy(String.valueOf(userId));
|
||||
wornTechnicalAppraisal.setCreateTime(now);
|
||||
wornTechnicalAppraisal.setIsDelete("0");
|
||||
|
||||
int rows = wornTechnicalAppraisalMapper.insertWornTechnicalAppraisal(wornTechnicalAppraisal);
|
||||
if (rows <= 0)
|
||||
{
|
||||
throw new RuntimeException("技术鉴定表新增失败");
|
||||
}
|
||||
|
||||
Long appraisalId = wornTechnicalAppraisal.getId();
|
||||
if (appraisalId == null)
|
||||
{
|
||||
throw new RuntimeException("技术鉴定表新增失败,ID未回填");
|
||||
}
|
||||
|
||||
/* ================== 6. 保存附件 ================== */
|
||||
List<WornTechnicalAppraisalFile> fileList = wornTechnicalAppraisal.getFileList();
|
||||
if (fileList != null && !fileList.isEmpty())
|
||||
{
|
||||
Long sortNum = 1L;
|
||||
for (WornTechnicalAppraisalFile file : fileList)
|
||||
{
|
||||
if (file == null || StringUtils.isEmpty(file.getFileUrl()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
file.setAppraisalId(appraisalId);
|
||||
file.setSortNum(sortNum++);
|
||||
file.setCreateBy(String.valueOf(userId));
|
||||
file.setCreateTime(now);
|
||||
file.setIsDelete("0");
|
||||
|
||||
int fileRows = wornTechnicalAppraisalFileMapper.insertWornTechnicalAppraisalFile(file);
|
||||
if (fileRows <= 0)
|
||||
{
|
||||
throw new RuntimeException("技术鉴定附件保存失败:" + file.getFileName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo selectMyTechnicalAppraisalSimplePageList()
|
||||
{
|
||||
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
|
||||
|
||||
WornTechnicalAppraisal query = new WornTechnicalAppraisal();
|
||||
query.setUserId(userId);
|
||||
|
||||
// 这里的分页由 Controller 里的 startPage() 生效
|
||||
List<WornTechnicalAppraisal> list =
|
||||
wornTechnicalAppraisalMapper.selectMyTechnicalAppraisalList(query);
|
||||
|
||||
// 保留原始分页信息
|
||||
PageInfo<WornTechnicalAppraisal> pageInfo = new PageInfo<>(list);
|
||||
|
||||
List<WornTechnicalAppraisalSimpleDTO> result = new ArrayList<>();
|
||||
|
||||
if (list != null && !list.isEmpty())
|
||||
{
|
||||
for (WornTechnicalAppraisal appraisal : list)
|
||||
{
|
||||
WornTechnicalAppraisalSimpleDTO dto = new WornTechnicalAppraisalSimpleDTO();
|
||||
dto.setId(appraisal.getId());
|
||||
dto.setAppraisalNo(appraisal.getAppraisalNo());
|
||||
dto.setCreateTime(appraisal.getCreateTime());
|
||||
dto.setAppraisalDesc(appraisal.getAppraisalDesc());
|
||||
dto.setRemark(appraisal.getRemark());
|
||||
// 查询附件
|
||||
List<WornTechnicalAppraisalFile> fileList =
|
||||
wornTechnicalAppraisalFileMapper.selectWornTechnicalAppraisalFileByAppraisalId(appraisal.getId());
|
||||
|
||||
List<AppraisalFileDTO> fileDtoList = new ArrayList<>();
|
||||
|
||||
if (fileList != null && !fileList.isEmpty())
|
||||
{
|
||||
for (WornTechnicalAppraisalFile file : fileList)
|
||||
{
|
||||
if (file == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
AppraisalFileDTO fileDTO = new AppraisalFileDTO();
|
||||
fileDTO.setName(file.getFileName());
|
||||
fileDTO.setUrl(file.getFileUrl());
|
||||
fileDtoList.add(fileDTO);
|
||||
}
|
||||
}
|
||||
|
||||
dto.setFileUrlList(fileDtoList);
|
||||
result.add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(200);
|
||||
rspData.setRows(result);
|
||||
rspData.setTotal(pageInfo.getTotal());
|
||||
return rspData;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,8 @@
|
||||
<result property="materialShortName" column="materialShortName"/>
|
||||
<result property="specification" column="specification"/>
|
||||
<result property="model" column="model"/>
|
||||
<result property="unitId" column="unitId"/>
|
||||
<result property="unitName" column="unitName"/>
|
||||
<result property="typeName" column="typeName"/>
|
||||
<result property="typeParentNames" column="typeParentNames"/>
|
||||
</resultMap>
|
||||
@@ -181,7 +183,8 @@
|
||||
ucm.remark AS remark,
|
||||
uc.code AS uniqueCode,
|
||||
COALESCE(ucm.is_delete, '0') AS isDelete,
|
||||
|
||||
m.unit_id AS unitId,
|
||||
mu.unit_name AS unitName,
|
||||
m.material_name AS materialName,
|
||||
m.material_code AS materialCode,
|
||||
m.material_short_name AS materialShortName,
|
||||
@@ -202,7 +205,8 @@
|
||||
ON ucm.material_id = m.id
|
||||
LEFT JOIN worn_material_type mt
|
||||
ON m.type_id = mt.id
|
||||
|
||||
LEFT JOIN worn_material_unit mu
|
||||
ON m.unit_id = mu.id
|
||||
WHERE uc.code = #{code}
|
||||
AND (uc.is_delete = '0' OR uc.is_delete IS NULL)
|
||||
AND (ucm.id IS NULL OR ucm.is_delete = '0')
|
||||
|
||||
@@ -145,7 +145,6 @@
|
||||
<update id="updateWornUniqueCodeMaterial" parameterType="WornUniqueCodeMaterial">
|
||||
update worn_unique_code_material
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">unique_code_id = #{uniqueCodeId},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
@@ -156,7 +155,7 @@
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
where unique_code_id = #{uniqueCodeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornUniqueCodeMaterialById" parameterType="Long">
|
||||
@@ -169,5 +168,10 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDeleteByUniqueCodeId">
|
||||
UPDATE worn_unique_code_material
|
||||
SET is_delete = '1',
|
||||
update_time = NOW()
|
||||
WHERE unique_code_id = #{uniqueCodeId}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -20,10 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="projectId" column="project_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornInboundBillVo">
|
||||
select id, bill_no, bill_type, warehouse_code, warehouse_name, area_code, area_name, remark, inbound_time, status, is_delete, create_by, create_time, update_by, update_time from worn_inbound_bill
|
||||
select id, bill_no, bill_type, warehouse_code, warehouse_name, area_code, area_name, remark, inbound_time, status, is_delete, create_by, create_time, update_by, update_time,project_id from worn_inbound_bill
|
||||
</sql>
|
||||
|
||||
<select id="selectWornInboundBillList" parameterType="WornInboundBill" resultMap="WornInboundBillResult">
|
||||
@@ -37,7 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="inboundTime != null "> and inbound_time = #{inboundTime}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
||||
<if test="projectId != null"> and project_id = #{projectId}</if>
|
||||
<if test="isDelete == null or isDelete == ''">and is_delete = '0'</if>
|
||||
<if test="billNo == null or billNo == ''">
|
||||
and bill_no like 'WR%'
|
||||
@@ -68,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="billNo != null and billNo != ''">#{billNo},</if>
|
||||
@@ -84,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
143
src/main/resources/mybatis/worn/WornOutboundBillMapper.xml
Normal file
143
src/main/resources/mybatis/worn/WornOutboundBillMapper.xml
Normal file
@@ -0,0 +1,143 @@
|
||||
<?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.shzg.project.worn.mapper.WornOutboundBillMapper">
|
||||
|
||||
<resultMap type="WornOutboundBill" id="WornOutboundBillResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="billNo" column="bill_no" />
|
||||
<result property="billType" column="bill_type" />
|
||||
<result property="warehouseCode" column="warehouse_code" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="outboundTime" column="outbound_time" />
|
||||
<result property="status" column="status" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="projectId" column="project_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornOutboundBillVo">
|
||||
select id, bill_no, bill_type, warehouse_code, warehouse_name, area_code, area_name, remark, outbound_time, status, is_delete, create_by, create_time, update_by, update_time, project_id from worn_outbound_bill
|
||||
</sql>
|
||||
|
||||
<select id="selectWornOutboundBillList" parameterType="WornOutboundBill" resultMap="WornOutboundBillResult">
|
||||
<include refid="selectWornOutboundBillVo"/>
|
||||
<where>
|
||||
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
||||
<if test="billType != null and billType != ''"> and bill_type = #{billType}</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
|
||||
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
|
||||
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
|
||||
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="outboundTime != null "> and outbound_time = #{outboundTime}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWornOutboundBillById" parameterType="Long" resultMap="WornOutboundBillResult">
|
||||
<include refid="selectWornOutboundBillVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWornOutboundBill" parameterType="WornOutboundBill" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_outbound_bill
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="billNo != null and billNo != ''">bill_no,</if>
|
||||
<if test="billType != null">bill_type,</if>
|
||||
<if test="warehouseCode != null">warehouse_code,</if>
|
||||
<if test="warehouseName != null">warehouse_name,</if>
|
||||
<if test="areaCode != null">area_code,</if>
|
||||
<if test="areaName != null">area_name,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="outboundTime != null">outbound_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="billNo != null and billNo != ''">#{billNo},</if>
|
||||
<if test="billType != null">#{billType},</if>
|
||||
<if test="warehouseCode != null">#{warehouseCode},</if>
|
||||
<if test="warehouseName != null">#{warehouseName},</if>
|
||||
<if test="areaCode != null">#{areaCode},</if>
|
||||
<if test="areaName != null">#{areaName},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="outboundTime != null">#{outboundTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornOutboundBill" parameterType="WornOutboundBill">
|
||||
update worn_outbound_bill
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="billType != null">bill_type = #{billType},</if>
|
||||
<if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if>
|
||||
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if>
|
||||
<if test="areaCode != null">area_code = #{areaCode},</if>
|
||||
<if test="areaName != null">area_name = #{areaName},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="outboundTime != null">outbound_time = #{outboundTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
</trim>
|
||||
where bill_no = #{billNo}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornOutboundBillById" parameterType="Long">
|
||||
delete from worn_outbound_bill where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornOutboundBillByIds" parameterType="String">
|
||||
delete from worn_outbound_bill where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectWornOutboundBillByBillNo" parameterType="java.lang.String" resultMap="WornOutboundBillResult">
|
||||
select
|
||||
id,
|
||||
bill_no,
|
||||
bill_type,
|
||||
warehouse_code,
|
||||
warehouse_name,
|
||||
area_code,
|
||||
area_name,
|
||||
remark,
|
||||
outbound_time,
|
||||
status,
|
||||
is_delete,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
project_id
|
||||
from worn_outbound_bill
|
||||
where bill_no = #{billNo}
|
||||
and (is_delete = '0' or is_delete is null)
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
175
src/main/resources/mybatis/worn/WornOutboundItemMapper.xml
Normal file
175
src/main/resources/mybatis/worn/WornOutboundItemMapper.xml
Normal file
@@ -0,0 +1,175 @@
|
||||
<?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.shzg.project.worn.mapper.WornOutboundItemMapper">
|
||||
|
||||
<resultMap type="WornOutboundItem" id="WornOutboundItemResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="billId" column="bill_id"/>
|
||||
<result property="billNo" column="bill_no"/>
|
||||
<result property="billType" column="bill_type"/>
|
||||
|
||||
<result property="warehouseCode" column="warehouse_code"/>
|
||||
<result property="warehouseName" column="warehouse_name"/>
|
||||
<result property="areaCode" column="area_code"/>
|
||||
<result property="areaName" column="area_name"/>
|
||||
<result property="billRemark" column="bill_remark"/>
|
||||
<result property="outboundTime" column="outbound_time"/>
|
||||
<result property="billStatus" column="bill_status"/>
|
||||
|
||||
<result property="materialId" column="material_id"/>
|
||||
<result property="materialName" column="material_name"/>
|
||||
<result property="materialCode" column="material_code"/>
|
||||
<result property="materialShortName" column="material_short_name"/>
|
||||
<result property="specification" column="specification"/>
|
||||
<result property="model" column="model"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="uniqueCode" column="unique_code"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
|
||||
<result property="typeName" column="type_name"/>
|
||||
<result property="typeParentNames" column="type_parent_names"/>
|
||||
<result property="unitId" column="unit_id"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="status" column="status"/>
|
||||
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornOutboundItemVo">
|
||||
select id, bill_id, bill_no, material_id, quantity, unique_code, remark, status, is_delete, create_by, create_time, update_by, update_time from worn_outbound_item
|
||||
</sql>
|
||||
|
||||
<select id="selectWornOutboundItemList" parameterType="com.shzg.project.worn.domain.WornOutboundItem"
|
||||
resultMap="WornOutboundItemResult">
|
||||
SELECT
|
||||
oi.id,
|
||||
oi.bill_id,
|
||||
oi.bill_no,
|
||||
ob.bill_type,
|
||||
ob.warehouse_code,
|
||||
ob.warehouse_name,
|
||||
ob.area_code,
|
||||
ob.area_name,
|
||||
ob.remark AS bill_remark,
|
||||
ob.outbound_time,
|
||||
ob.status AS bill_status,
|
||||
ob.create_time,
|
||||
|
||||
oi.material_id,
|
||||
oi.quantity,
|
||||
oi.unique_code,
|
||||
oi.remark,
|
||||
COALESCE(oi.is_delete, '0') AS is_delete,
|
||||
|
||||
m.material_name,
|
||||
m.material_code,
|
||||
m.material_short_name,
|
||||
m.specification,
|
||||
m.model,
|
||||
m.unit_id,
|
||||
mu.unit_name,
|
||||
|
||||
uc.status,
|
||||
mt.type_name,
|
||||
(
|
||||
SELECT GROUP_CONCAT(t2.type_name ORDER BY t2.id SEPARATOR '/')
|
||||
FROM worn_material_type t2
|
||||
WHERE FIND_IN_SET(t2.id, mt.ancestors) OR t2.id = mt.id
|
||||
) AS type_parent_names
|
||||
|
||||
FROM worn_outbound_item oi
|
||||
LEFT JOIN worn_outbound_bill ob ON oi.bill_id = ob.id
|
||||
LEFT JOIN worn_material m ON oi.material_id = m.id
|
||||
LEFT JOIN worn_material_type mt ON m.type_id = mt.id
|
||||
LEFT JOIN worn_material_unit mu ON m.unit_id = mu.id
|
||||
LEFT JOIN worn_unique_code uc ON oi.unique_code = uc.code
|
||||
|
||||
WHERE (oi.is_delete = '0' OR oi.is_delete IS NULL)
|
||||
AND (ob.is_delete = '0' OR ob.is_delete IS NULL)
|
||||
AND (m.is_delete = '0' OR m.is_delete IS NULL)
|
||||
AND (mu.is_delete = '0' OR mu.is_delete IS NULL)
|
||||
AND oi.bill_no = #{billNo}
|
||||
|
||||
ORDER BY oi.id ASC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectWornOutboundItemById" parameterType="Long" resultMap="WornOutboundItemResult">
|
||||
<include refid="selectWornOutboundItemVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWornOutboundItem" parameterType="WornOutboundItem" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_outbound_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="billId != null">bill_id,</if>
|
||||
<if test="billNo != null">bill_no,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="uniqueCode != null">unique_code,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="billId != null">#{billId},</if>
|
||||
<if test="billNo != null">#{billNo},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="uniqueCode != null">#{uniqueCode},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornOutboundItem" parameterType="WornOutboundItem">
|
||||
update worn_outbound_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="billId != null">bill_id = #{billId},</if>
|
||||
<if test="billNo != null">bill_no = #{billNo},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="uniqueCode != null">unique_code = #{uniqueCode},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornOutboundItemById" parameterType="Long">
|
||||
delete from worn_outbound_item where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornOutboundItemByIds">
|
||||
delete from worn_outbound_item where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="countNotOutboundByBillId" resultType="int">
|
||||
select count(1)
|
||||
from worn_outbound_item oi
|
||||
left join worn_unique_code uc on oi.unique_code = uc.code
|
||||
where oi.bill_id = #{billId}
|
||||
and (oi.is_delete = '0' or oi.is_delete is null)
|
||||
and (uc.is_delete = '0' or uc.is_delete is null)
|
||||
and uc.status != '4'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,114 @@
|
||||
<?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.shzg.project.worn.mapper.WornTechnicalAppraisalFileMapper">
|
||||
|
||||
<resultMap type="WornTechnicalAppraisalFile" id="WornTechnicalAppraisalFileResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="appraisalId" column="appraisal_id" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="fileUrl" column="file_url" />
|
||||
<result property="fileType" column="file_type" />
|
||||
<result property="sortNum" column="sort_num" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornTechnicalAppraisalFileVo">
|
||||
select id, appraisal_id, file_name, file_url, file_type, sort_num, remark, create_by, create_time, is_delete from worn_technical_appraisal_file
|
||||
</sql>
|
||||
|
||||
<select id="selectWornTechnicalAppraisalFileList" parameterType="WornTechnicalAppraisalFile" resultMap="WornTechnicalAppraisalFileResult">
|
||||
<include refid="selectWornTechnicalAppraisalFileVo"/>
|
||||
<where>
|
||||
<if test="appraisalId != null "> and appraisal_id = #{appraisalId}</if>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
|
||||
<if test="sortNum != null "> and sort_num = #{sortNum}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWornTechnicalAppraisalFileById" parameterType="Long" resultMap="WornTechnicalAppraisalFileResult">
|
||||
<include refid="selectWornTechnicalAppraisalFileVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWornTechnicalAppraisalFile" parameterType="WornTechnicalAppraisalFile" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_technical_appraisal_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="appraisalId != null">appraisal_id,</if>
|
||||
<if test="fileName != null and fileName != ''">file_name,</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">file_url,</if>
|
||||
<if test="fileType != null and fileType != ''">file_type,</if>
|
||||
<if test="sortNum != null">sort_num,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="isDelete != null and isDelete != ''">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="appraisalId != null">#{appraisalId},</if>
|
||||
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">#{fileUrl},</if>
|
||||
<if test="fileType != null and fileType != ''">#{fileType},</if>
|
||||
<if test="sortNum != null">#{sortNum},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="isDelete != null and isDelete != ''">#{isDelete},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornTechnicalAppraisalFile" parameterType="WornTechnicalAppraisalFile">
|
||||
update worn_technical_appraisal_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="appraisalId != null">appraisal_id = #{appraisalId},</if>
|
||||
<if test="fileName != null">file_name = #{fileName},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
<if test="fileType != null">file_type = #{fileType},</if>
|
||||
<if test="sortNum != null">sort_num = #{sortNum},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornTechnicalAppraisalFileById" parameterType="Long">
|
||||
delete from worn_technical_appraisal_file where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornTechnicalAppraisalFileByIds" parameterType="String">
|
||||
delete from worn_technical_appraisal_file where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectWornTechnicalAppraisalFileByAppraisalId"
|
||||
parameterType="java.lang.Long"
|
||||
resultType="com.shzg.project.worn.domain.WornTechnicalAppraisalFile">
|
||||
|
||||
SELECT
|
||||
id,
|
||||
appraisal_id,
|
||||
file_name,
|
||||
file_url,
|
||||
file_type,
|
||||
sort_num,
|
||||
remark,
|
||||
create_by,
|
||||
create_time,
|
||||
is_delete
|
||||
FROM worn_technical_appraisal_file
|
||||
WHERE appraisal_id = #{appraisalId}
|
||||
AND (is_delete = '0' OR is_delete IS NULL)
|
||||
ORDER BY sort_num ASC, id ASC
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
150
src/main/resources/mybatis/worn/WornTechnicalAppraisalMapper.xml
Normal file
150
src/main/resources/mybatis/worn/WornTechnicalAppraisalMapper.xml
Normal file
@@ -0,0 +1,150 @@
|
||||
<?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.shzg.project.worn.mapper.WornTechnicalAppraisalMapper">
|
||||
|
||||
<resultMap type="WornTechnicalAppraisal" id="WornTechnicalAppraisalResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="appraisalNo" column="appraisal_no" />
|
||||
<result property="billId" column="bill_id" />
|
||||
<result property="billNo" column="bill_no" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="appraisalDesc" column="appraisal_desc" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornTechnicalAppraisalVo">
|
||||
select id, appraisal_no, bill_id, bill_no, project_id, user_id, user_name, appraisal_desc, status, remark, create_by, create_time, update_by, update_time, is_delete from worn_technical_appraisal
|
||||
</sql>
|
||||
|
||||
<select id="selectWornTechnicalAppraisalList" parameterType="WornTechnicalAppraisal" resultMap="WornTechnicalAppraisalResult">
|
||||
select *
|
||||
from worn_technical_appraisal
|
||||
<where>
|
||||
(is_delete = '0' or is_delete is null)
|
||||
<if test="billNo != null and billNo != ''">
|
||||
and bill_no = #{billNo}
|
||||
</if>
|
||||
<if test="appraisalNo != null and appraisalNo != ''">
|
||||
and appraisal_no = #{appraisalNo}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectWornTechnicalAppraisalById" parameterType="Long" resultMap="WornTechnicalAppraisalResult">
|
||||
<include refid="selectWornTechnicalAppraisalVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWornTechnicalAppraisal" parameterType="WornTechnicalAppraisal" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_technical_appraisal
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="appraisalNo != null and appraisalNo != ''">appraisal_no,</if>
|
||||
<if test="billId != null">bill_id,</if>
|
||||
<if test="billNo != null and billNo != ''">bill_no,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="appraisalDesc != null and appraisalDesc != ''">appraisal_desc,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="isDelete != null and isDelete != ''">is_delete,</if>
|
||||
</trim>
|
||||
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="appraisalNo != null and appraisalNo != ''">#{appraisalNo},</if>
|
||||
<if test="billId != null">#{billId},</if>
|
||||
<if test="billNo != null and billNo != ''">#{billNo},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="appraisalDesc != null and appraisalDesc != ''">#{appraisalDesc},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="isDelete != null and isDelete != ''">#{isDelete},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornTechnicalAppraisal" parameterType="WornTechnicalAppraisal">
|
||||
update worn_technical_appraisal
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="appraisalNo != null and appraisalNo != ''">appraisal_no = #{appraisalNo},</if>
|
||||
<if test="billId != null">bill_id = #{billId},</if>
|
||||
<if test="billNo != null">bill_no = #{billNo},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="appraisalDesc != null">appraisal_desc = #{appraisalDesc},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornTechnicalAppraisalById" parameterType="Long">
|
||||
delete from worn_technical_appraisal where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornTechnicalAppraisalByIds" parameterType="String">
|
||||
delete from worn_technical_appraisal where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectMyTechnicalAppraisalList" parameterType="WornTechnicalAppraisal" resultMap="WornTechnicalAppraisalResult">
|
||||
select
|
||||
id,
|
||||
appraisal_no,
|
||||
bill_id,
|
||||
bill_no,
|
||||
project_id,
|
||||
user_id,
|
||||
user_name,
|
||||
appraisal_desc,
|
||||
status,
|
||||
remark,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
is_delete
|
||||
from worn_technical_appraisal
|
||||
<where>
|
||||
(is_delete = '0' or is_delete is null)
|
||||
and user_id = #{userId}
|
||||
|
||||
<if test="appraisalNo != null and appraisalNo != ''">
|
||||
and appraisal_no like concat('%', #{appraisalNo}, '%')
|
||||
</if>
|
||||
<if test="billNo != null and billNo != ''">
|
||||
and bill_no like concat('%', #{billNo}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc, id desc
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user