申报单部分代码

This commit is contained in:
2026-04-20 09:12:46 +08:00
parent b41c5d6c51
commit 2d7b81bd93
34 changed files with 2937 additions and 53 deletions

View File

@@ -70,5 +70,7 @@ public interface WornUniqueCodeMaterialMapper
* 更新唯一码状态
* */
public int updateDeleteByUniqueCodeId(Long uniqueCodeId);
WornUniqueCodeMaterial selectByUniqueCodeId(Long uniqueCodeId);
int deleteByUniqueCodeId(Long uniqueCodeId);
}

View File

@@ -0,0 +1,123 @@
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.WornDeclareBill;
import com.shzg.project.worn.service.IWornDeclareBillService;
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-14
*/
@RestController
@RequestMapping("/worn/declareBill")
public class WornDeclareBillController extends BaseController
{
@Autowired
private IWornDeclareBillService wornDeclareBillService;
/**
* 查询申报单查看列表
*/
//@PreAuthorize("@ss.hasPermi('worn:declareBill:list')")
@GetMapping("/list")
public TableDataInfo list(WornDeclareBill wornDeclareBill)
{
startPage();
if (!SecurityUtils.isAdmin())
{
wornDeclareBill.setProjectId(SecurityUtils.getDeptId());
}
List<WornDeclareBill> list = wornDeclareBillService.selectWornDeclareBillList(wornDeclareBill);
return getDataTable(list);
}
/**
* 导出申报单查看列表
*/
@PreAuthorize("@ss.hasPermi('worn:declareBill:export')")
@Log(title = "申报单查看", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WornDeclareBill wornDeclareBill)
{
List<WornDeclareBill> list = wornDeclareBillService.selectWornDeclareBillList(wornDeclareBill);
ExcelUtil<WornDeclareBill> util = new ExcelUtil<WornDeclareBill>(WornDeclareBill.class);
util.exportExcel(response, list, "申报单查看数据");
}
/**
* 获取申报单查看详细信息
*/
@PreAuthorize("@ss.hasPermi('worn:declareBill:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(wornDeclareBillService.selectWornDeclareBillById(id));
}
/**
* 新增申报单查看
*/
/**
* 新增申报单
*/
@Log(title = "申报单", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody WornDeclareBill wornDeclareBill)
{
return toAjax(wornDeclareBillService.insertWornDeclareBill(wornDeclareBill));
}
/**
* 修改申报单查看
*/
// @PreAuthorize("@ss.hasPermi('worn:declareBill:edit')")
@Log(title = "申报单查看", businessType = BusinessType.UPDATE)
@PutMapping("/update")
public AjaxResult edit(@RequestBody WornDeclareBill wornDeclareBill)
{
return toAjax(wornDeclareBillService.updateWornDeclareBill(wornDeclareBill));
}
/**
* 删除申报单查看
*/
@PreAuthorize("@ss.hasPermi('worn:declareBill:remove')")
@Log(title = "申报单查看", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wornDeclareBillService.deleteWornDeclareBillByIds(ids));
}
/**
* 根据申报单号查询申报单详情
*/
@GetMapping("/detail")
public AjaxResult detail(@RequestParam("billNo") String billNo)
{
return AjaxResult.success(wornDeclareBillService.selectWornDeclareBillDetailByBillNo(billNo));
}
/**
* 作废申报单
*/
@PutMapping("/cancel/{id}")
public AjaxResult cancel(@PathVariable("id") Long id)
{
return toAjax(wornDeclareBillService.cancelWornDeclareBill(id));
}
}

View File

@@ -0,0 +1,104 @@
package com.shzg.project.worn.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.WornDeclareFile;
import com.shzg.project.worn.service.IWornDeclareFileService;
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-14
*/
@RestController
@RequestMapping("/worn/declareFile")
public class WornDeclareFileController extends BaseController
{
@Autowired
private IWornDeclareFileService wornDeclareFileService;
/**
* 查询申报单附件列表
*/
@PreAuthorize("@ss.hasPermi('worn:declareFile:list')")
@GetMapping("/list")
public TableDataInfo list(WornDeclareFile wornDeclareFile)
{
startPage();
List<WornDeclareFile> list = wornDeclareFileService.selectWornDeclareFileList(wornDeclareFile);
return getDataTable(list);
}
/**
* 导出申报单附件列表
*/
@PreAuthorize("@ss.hasPermi('worn:declareFile:export')")
@Log(title = "申报单附件", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WornDeclareFile wornDeclareFile)
{
List<WornDeclareFile> list = wornDeclareFileService.selectWornDeclareFileList(wornDeclareFile);
ExcelUtil<WornDeclareFile> util = new ExcelUtil<WornDeclareFile>(WornDeclareFile.class);
util.exportExcel(response, list, "申报单附件数据");
}
/**
* 获取申报单附件详细信息
*/
@PreAuthorize("@ss.hasPermi('worn:declareFile:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(wornDeclareFileService.selectWornDeclareFileById(id));
}
/**
* 新增申报单附件
*/
@PreAuthorize("@ss.hasPermi('worn:declareFile:add')")
@Log(title = "申报单附件", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WornDeclareFile wornDeclareFile)
{
return toAjax(wornDeclareFileService.insertWornDeclareFile(wornDeclareFile));
}
/**
* 修改申报单附件
*/
@PreAuthorize("@ss.hasPermi('worn:declareFile:edit')")
@Log(title = "申报单附件", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WornDeclareFile wornDeclareFile)
{
return toAjax(wornDeclareFileService.updateWornDeclareFile(wornDeclareFile));
}
/**
* 删除申报单附件
*/
@PreAuthorize("@ss.hasPermi('worn:declareFile:remove')")
@Log(title = "申报单附件", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wornDeclareFileService.deleteWornDeclareFileByIds(ids));
}
}

View File

@@ -0,0 +1,104 @@
package com.shzg.project.worn.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.WornDeclareItem;
import com.shzg.project.worn.service.IWornDeclareItemService;
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-14
*/
@RestController
@RequestMapping("/worn/declareItem")
public class WornDeclareItemController extends BaseController
{
@Autowired
private IWornDeclareItemService wornDeclareItemService;
/**
* 查询申报单物料明细列表
*/
@PreAuthorize("@ss.hasPermi('worn:declareItem:list')")
@GetMapping("/list")
public TableDataInfo list(WornDeclareItem wornDeclareItem)
{
startPage();
List<WornDeclareItem> list = wornDeclareItemService.selectWornDeclareItemList(wornDeclareItem);
return getDataTable(list);
}
/**
* 导出申报单物料明细列表
*/
@PreAuthorize("@ss.hasPermi('worn:declareItem:export')")
@Log(title = "申报单物料明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WornDeclareItem wornDeclareItem)
{
List<WornDeclareItem> list = wornDeclareItemService.selectWornDeclareItemList(wornDeclareItem);
ExcelUtil<WornDeclareItem> util = new ExcelUtil<WornDeclareItem>(WornDeclareItem.class);
util.exportExcel(response, list, "申报单物料明细数据");
}
/**
* 获取申报单物料明细详细信息
*/
@PreAuthorize("@ss.hasPermi('worn:declareItem:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(wornDeclareItemService.selectWornDeclareItemById(id));
}
/**
* 新增申报单物料明细
*/
@PreAuthorize("@ss.hasPermi('worn:declareItem:add')")
@Log(title = "申报单物料明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WornDeclareItem wornDeclareItem)
{
return toAjax(wornDeclareItemService.insertWornDeclareItem(wornDeclareItem));
}
/**
* 修改申报单物料明细
*/
@PreAuthorize("@ss.hasPermi('worn:declareItem:edit')")
@Log(title = "申报单物料明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WornDeclareItem wornDeclareItem)
{
return toAjax(wornDeclareItemService.updateWornDeclareItem(wornDeclareItem));
}
/**
* 删除申报单物料明细
*/
@PreAuthorize("@ss.hasPermi('worn:declareItem:remove')")
@Log(title = "申报单物料明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wornDeclareItemService.deleteWornDeclareItemByIds(ids));
}
}

View File

@@ -1,6 +1,7 @@
package com.shzg.project.worn.controller;
import java.util.List;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import com.shzg.common.utils.SecurityUtils;
@@ -127,10 +128,17 @@ public class WornInboundBillController extends BaseController
{
byte[] pdf = wornInboundBillService.generatePdf(id);
response.reset();
response.setContentType("application/pdf");
response.setCharacterEncoding("UTF-8");
response.setContentLength(pdf.length);
response.setHeader("Content-Disposition", "inline; filename=inbound.pdf");
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0");
response.getOutputStream().write(pdf);
ServletOutputStream outputStream = response.getOutputStream();
outputStream.write(pdf);
outputStream.flush();
outputStream.close();
}
}

View File

@@ -94,22 +94,22 @@ public class WornTechnicalAppraisalController extends BaseController
}
/**
* 删除技术鉴定
* 删除技术鉴定
*/
@PreAuthorize("@ss.hasPermi('worn:appraisal:remove')")
@Log(title = "技术鉴定", businessType = BusinessType.DELETE)
@DeleteMapping("/delete")
public AjaxResult remove(@PathVariable Long[] ids)
@Log(title = "技术鉴定", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable("id") Long id)
{
return toAjax(wornTechnicalAppraisalService.deleteWornTechnicalAppraisalByIds(ids));
return toAjax(wornTechnicalAppraisalService.deleteWornTechnicalAppraisalById(id));
}
/**
* 新增技术鉴定表(含附件)
*/
@PostMapping("/addWithFiles")
public AjaxResult addWithFiles(@RequestBody WornTechnicalAppraisal wornTechnicalAppraisal)
{
return toAjax(wornTechnicalAppraisalService.insertWornTechnicalAppraisalWithFiles(wornTechnicalAppraisal));
WornTechnicalAppraisalSimpleDTO dto =
wornTechnicalAppraisalService.insertWornTechnicalAppraisalWithFiles(wornTechnicalAppraisal);
return AjaxResult.success(dto);
}
@GetMapping("/myList")
public TableDataInfo myList()

View File

@@ -0,0 +1,188 @@
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_declare_bill
*
* @author shzg
* @date 2026-04-14
*/
public class WornDeclareBill extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 申报单号 */
@Excel(name = "申报单号")
private String billNo;
/** 项目ID对应sys_dept.dept_id */
@Excel(name = "项目ID", readConverterExp = "对=应sys_dept.dept_id")
private Long projectId;
/** 联系人 */
@Excel(name = "联系人")
private String contactName;
/** 联系电话 */
@Excel(name = "联系电话")
private String contactPhone;
/** 交付时间 */
@Excel(name = "交付时间")
private String deliveryTime; // 0 15天1 立即 2其他
/** 存放地址 */
@Excel(name = "存放地址")
private String address;
/** 状态0草稿1已提交2已转入库9已作废 */
@Excel(name = "状态", readConverterExp = "0=草稿1已提交2已转入库9已作废")
private String status;
/** 是否删除0正常 1删除 */
@Excel(name = "是否删除", readConverterExp = "0=正常,1=删除")
private String isDelete;
/** 物料列表 */
private List<WornDeclareItem> itemList;
/** 附件列表 */
private List<WornDeclareFile> fileList;
public List<WornDeclareFile> getFileList()
{
return fileList;
}
public void setFileList(List<WornDeclareFile> fileList)
{
this.fileList = fileList;
}
public List<WornDeclareItem> getItemList()
{
return itemList;
}
public void setItemList(List<WornDeclareItem> itemList)
{
this.itemList = 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 setProjectId(Long projectId)
{
this.projectId = projectId;
}
public Long getProjectId()
{
return projectId;
}
public void setContactName(String contactName)
{
this.contactName = contactName;
}
public String getContactName()
{
return contactName;
}
public void setContactPhone(String contactPhone)
{
this.contactPhone = contactPhone;
}
public String getContactPhone()
{
return contactPhone;
}
public void setDeliveryTime(String deliveryTime)
{
this.deliveryTime = deliveryTime;
}
public String getDeliveryTime()
{
return deliveryTime;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("billNo", getBillNo())
.append("projectId", getProjectId())
.append("contactName", getContactName())
.append("contactPhone", getContactPhone())
.append("deliveryTime", getDeliveryTime())
.append("address", getAddress())
.append("remark", getRemark())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDelete", getIsDelete())
.toString();
}
}

View File

@@ -0,0 +1,169 @@
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_declare_file
*
* @author shzg
* @date 2026-04-14
*/
public class WornDeclareFile extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 文件名 */
private String name;
/** 文件地址 */
private String url;
/** 主键ID */
private Long id;
/** 申报单ID */
@Excel(name = "申报单ID")
private Long billId;
/** 申报单号 */
@Excel(name = "申报单号")
private String billNo;
/** 文件名 */
@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 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 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;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("billId", getBillId())
.append("billNo", getBillNo())
.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();
}
}

View File

@@ -0,0 +1,139 @@
package com.shzg.project.worn.domain;
import java.math.BigDecimal;
import java.util.Date;
public class WornDeclareItem
{
/** ===== 主表bill===== */
private Long billId;
private String billNo;
private Long projectId;
private String contactName;
private String contactPhone;
private String deliveryTime;
private String address;
private String billRemark;
private String billStatus;
private String updateBy;
private Date updateTime;
/** ===== 明细item===== */
private Long id;
private Long materialId;
private BigDecimal quantity;
private Integer uniqueCode;
private String remark;
private String isDelete;
private String createBy;
private Date createTime;
private String status;
/** ===== 物料material===== */
private String materialName;
private String materialCode;
private String materialShortName;
private String specification;
private String model;
private BigDecimal weight;
/** ===== 单位 ===== */
private Long unitId;
private String unitName;
/** ===== 类型 ===== */
private String typeName;
private String typeParentNames;
// ================= getter / setter =================
public Long getBillId() { return billId; }
public void setBillId(Long billId) { this.billId = billId; }
public String getBillNo() { return billNo; }
public void setBillNo(String billNo) { this.billNo = billNo; }
public Long getProjectId() { return projectId; }
public void setProjectId(Long projectId) { this.projectId = projectId; }
public String getContactName() { return contactName; }
public void setContactName(String contactName) { this.contactName = contactName; }
public String getContactPhone() { return contactPhone; }
public void setContactPhone(String contactPhone) { this.contactPhone = contactPhone; }
public String getDeliveryTime() { return deliveryTime; }
public void setDeliveryTime(String deliveryTime) { this.deliveryTime = deliveryTime; }
public String getAddress() { return address; }
public void setAddress(String address) { this.address = address; }
public String getBillRemark() { return billRemark; }
public void setBillRemark(String billRemark) { this.billRemark = billRemark; }
public String getBillStatus() { return billStatus; }
public void setBillStatus(String billStatus) { this.billStatus = billStatus; }
public String getUpdateBy() { return updateBy; }
public void setUpdateBy(String updateBy) { this.updateBy = updateBy; }
public Date getUpdateTime() { return updateTime; }
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public Long getMaterialId() { return materialId; }
public void setMaterialId(Long materialId) { this.materialId = materialId; }
public BigDecimal getQuantity() { return quantity; }
public void setQuantity(BigDecimal quantity) { this.quantity = quantity; }
public Integer getUniqueCode() { return uniqueCode; }
public void setUniqueCode(Integer uniqueCode) { this.uniqueCode = uniqueCode; }
public String getRemark() { return remark; }
public void setRemark(String remark) { this.remark = remark; }
public String getIsDelete() { return isDelete; }
public void setIsDelete(String isDelete) { this.isDelete = isDelete; }
public String getCreateBy() { return createBy; }
public void setCreateBy(String createBy) { this.createBy = createBy; }
public Date getCreateTime() { return createTime; }
public void setCreateTime(Date createTime) { this.createTime = createTime; }
public String getStatus() { return status; }
public void setStatus(String status) { this.status = status; }
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 getMaterialShortName() { return materialShortName; }
public void setMaterialShortName(String materialShortName) { this.materialShortName = materialShortName; }
public String getSpecification() { return specification; }
public void setSpecification(String specification) { this.specification = specification; }
public String getModel() { return model; }
public void setModel(String model) { this.model = model; }
public BigDecimal getWeight() { return weight; }
public void setWeight(BigDecimal weight) { this.weight = weight; }
public Long getUnitId() { return unitId; }
public void setUnitId(Long unitId) { this.unitId = unitId; }
public String getUnitName() { return unitName; }
public void setUnitName(String unitName) { this.unitName = unitName; }
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; }
}

View File

@@ -1,6 +1,7 @@
package com.shzg.project.worn.domain;
import com.shzg.framework.web.domain.BaseEntity;
import com.shzg.project.worn.domain.dto.AppraisalFileDTO;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.shzg.framework.aspectj.lang.annotation.Excel;
@@ -56,7 +57,7 @@ public class WornTechnicalAppraisal extends BaseEntity
@Excel(name = "是否删除", readConverterExp = "0=正常,1=删除")
private String isDelete;
/** 附件列表 */
private List<WornTechnicalAppraisalFile> fileList;
private List<AppraisalFileDTO> fileList;
public void setId(Long id)
{
this.id = id;
@@ -156,12 +157,12 @@ public class WornTechnicalAppraisal extends BaseEntity
{
return isDelete;
}
public List<WornTechnicalAppraisalFile> getFileList()
public List<AppraisalFileDTO> getFileList()
{
return fileList;
}
public void setFileList(List<WornTechnicalAppraisalFile> fileList)
public void setFileList(List<AppraisalFileDTO> fileList)
{
this.fileList = fileList;
}

View File

@@ -21,4 +21,20 @@ public class WornOutboundUpdateDTO {
private Date createTime;
private List<WornInboundItemDTO> itemList;
/** 技术鉴定表ID */
private Long appraisalId;
/** 技术鉴定编号 */
private String appraisalNo;
/** 技术鉴定说明 */
private String appraisalDesc;
/** 技术鉴定备注 */
private String appraisalRemark;
/** 技术鉴定创建时间 */
private Date appraisalTime;
/** 技术鉴定表附件 */
private List<AppraisalFileDTO> appraisalFileList;
}

View File

@@ -0,0 +1,72 @@
package com.shzg.project.worn.mapper;
import java.util.List;
import com.shzg.project.worn.domain.WornDeclareBill;
/**
* 申报单查看Mapper接口
*
* @author shzg
* @date 2026-04-14
*/
public interface WornDeclareBillMapper
{
/**
* 查询申报单查看
*
* @param id 申报单查看主键
* @return 申报单查看
*/
public WornDeclareBill selectWornDeclareBillById(Long id);
/**
* 查询申报单查看列表
*
* @param wornDeclareBill 申报单查看
* @return 申报单查看集合
*/
public List<WornDeclareBill> selectWornDeclareBillList(WornDeclareBill wornDeclareBill);
/**
* 新增申报单查看
*
* @param wornDeclareBill 申报单查看
* @return 结果
*/
public int insertWornDeclareBill(WornDeclareBill wornDeclareBill);
/**
* 修改申报单查看
*
* @param wornDeclareBill 申报单查看
* @return 结果
*/
public int updateWornDeclareBill(WornDeclareBill wornDeclareBill);
/**
* 删除申报单查看
*
* @param id 申报单查看主键
* @return 结果
*/
public int deleteWornDeclareBillById(Long id);
/**
* 批量删除申报单查看
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWornDeclareBillByIds(Long[] ids);
/**
* 根据申报单号查询申报单主表
*
* @param billNo 申报单号
* @return 申报单主表
*/
WornDeclareBill selectWornDeclareBillByBillNo(String billNo);
public int cancelWornDeclareBill(WornDeclareBill wornDeclareBill);
}

View File

@@ -0,0 +1,70 @@
package com.shzg.project.worn.mapper;
import java.util.List;
import com.shzg.project.worn.domain.WornDeclareFile;
/**
* 申报单附件Mapper接口
*
* @author shzg
* @date 2026-04-14
*/
public interface WornDeclareFileMapper
{
/**
* 查询申报单附件
*
* @param id 申报单附件主键
* @return 申报单附件
*/
public WornDeclareFile selectWornDeclareFileById(Long id);
/**
* 查询申报单附件列表
*
* @param wornDeclareFile 申报单附件
* @return 申报单附件集合
*/
public List<WornDeclareFile> selectWornDeclareFileList(WornDeclareFile wornDeclareFile);
/**
* 新增申报单附件
*
* @param wornDeclareFile 申报单附件
* @return 结果
*/
public int insertWornDeclareFile(WornDeclareFile wornDeclareFile);
/**
* 修改申报单附件
*
* @param wornDeclareFile 申报单附件
* @return 结果
*/
public int updateWornDeclareFile(WornDeclareFile wornDeclareFile);
/**
* 删除申报单附件
*
* @param id 申报单附件主键
* @return 结果
*/
public int deleteWornDeclareFileById(Long id);
/**
* 批量删除申报单附件
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWornDeclareFileByIds(Long[] ids);
/**
* 根据申报单ID查询附件列表
*
* @param billId 主表ID
* @return 附件列表
*/
List<WornDeclareFile> selectWornDeclareFileByBillId(Long billId);
int deleteWornDeclareFileByBillId(Long billId);
}

View File

@@ -0,0 +1,85 @@
package com.shzg.project.worn.mapper;
import java.util.Date;
import java.util.List;
import com.shzg.project.worn.domain.WornDeclareItem;
import io.lettuce.core.dynamic.annotation.Param;
/**
* 申报单物料明细Mapper接口
*
* @author shzg
* @date 2026-04-14
*/
public interface WornDeclareItemMapper
{
/**
* 查询申报单物料明细
*
* @param id 申报单物料明细主键
* @return 申报单物料明细
*/
public WornDeclareItem selectWornDeclareItemById(Long id);
/**
* 查询申报单物料明细列表
*
* @param wornDeclareItem 申报单物料明细
* @return 申报单物料明细集合
*/
public List<WornDeclareItem> selectWornDeclareItemList(WornDeclareItem wornDeclareItem);
/**
* 新增申报单物料明细
*
* @param wornDeclareItem 申报单物料明细
* @return 结果
*/
public int insertWornDeclareItem(WornDeclareItem wornDeclareItem);
/**
* 修改申报单物料明细
*
* @param wornDeclareItem 申报单物料明细
* @return 结果
*/
public int updateWornDeclareItem(WornDeclareItem wornDeclareItem);
/**
* 删除申报单物料明细
*
* @param id 申报单物料明细主键
* @return 结果
*/
public int deleteWornDeclareItemById(Long id);
/**
* 批量删除申报单物料明细
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWornDeclareItemByIds(Long[] ids);
/**
* 根据申报单号查询物料明细
*
* @param billNo 申报单号
* @return 明细列表
*/
List<WornDeclareItem> selectWornDeclareItemDetailByBillNo(String billNo);
int deleteWornDeclareItemByBillId(@Param("billId") Long billId,
@Param("updateBy") String updateBy,
@Param("updateTime") Date updateTime);
/**
* 作废申报单明细
*
* @param billId 申报单ID
* @param updateBy 更新人
* @param updateTime 更新时间
* @return 结果
*/
int cancelWornDeclareItemByBillId(@Param("billId") Long billId,
@Param("updateBy") String updateBy,
@Param("updateTime") Date updateTime);
}

View File

@@ -50,6 +50,7 @@ public interface WornTechnicalAppraisalFileMapper
* @return 结果
*/
public int deleteWornTechnicalAppraisalFileById(Long id);
int removeWornTechnicalAppraisalFileById(WornTechnicalAppraisalFile wornTechnicalAppraisalFile);
/**
* 批量删除技术鉴定附件

View File

@@ -42,7 +42,7 @@ public interface WornTechnicalAppraisalMapper
* @return 结果
*/
public int updateWornTechnicalAppraisal(WornTechnicalAppraisal wornTechnicalAppraisal);
int removeWornTechnicalAppraisalById(WornTechnicalAppraisal wornTechnicalAppraisal);
/**
* 删除技术鉴定
*

View File

@@ -0,0 +1,75 @@
package com.shzg.project.worn.service;
import java.util.List;
import com.shzg.project.worn.domain.WornDeclareBill;
/**
* 申报单查看Service接口
*
* @author shzg
* @date 2026-04-14
*/
public interface IWornDeclareBillService
{
/**
* 查询申报单查看
*
* @param id 申报单查看主键
* @return 申报单查看
*/
public WornDeclareBill selectWornDeclareBillById(Long id);
/**
* 查询申报单查看列表
*
* @param wornDeclareBill 申报单查看
* @return 申报单查看集合
*/
public List<WornDeclareBill> selectWornDeclareBillList(WornDeclareBill wornDeclareBill);
/**
* 新增申报单查看
*
* @param wornDeclareBill 申报单查看
* @return 结果
*/
public int insertWornDeclareBill(WornDeclareBill wornDeclareBill);
/**
* 修改申报单查看
*
* @param wornDeclareBill 申报单查看
* @return 结果
*/
public int updateWornDeclareBill(WornDeclareBill wornDeclareBill);
/**
* 批量删除申报单查看
*
* @param ids 需要删除的申报单查看主键集合
* @return 结果
*/
public int deleteWornDeclareBillByIds(Long[] ids);
/**
* 删除申报单查看信息
*
* @param id 申报单查看主键
* @return 结果
*/
public int deleteWornDeclareBillById(Long id);
/**
* 根据申报单号查询申报单详情
*
* @param billNo 申报单号
* @return 申报单详情
*/
WornDeclareBill selectWornDeclareBillDetailByBillNo(String billNo);
/**
* 作废申报单
*
* @param id 申报单ID
* @return 结果
*/
int cancelWornDeclareBill(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.shzg.project.worn.service;
import java.util.List;
import com.shzg.project.worn.domain.WornDeclareFile;
/**
* 申报单附件Service接口
*
* @author shzg
* @date 2026-04-14
*/
public interface IWornDeclareFileService
{
/**
* 查询申报单附件
*
* @param id 申报单附件主键
* @return 申报单附件
*/
public WornDeclareFile selectWornDeclareFileById(Long id);
/**
* 查询申报单附件列表
*
* @param wornDeclareFile 申报单附件
* @return 申报单附件集合
*/
public List<WornDeclareFile> selectWornDeclareFileList(WornDeclareFile wornDeclareFile);
/**
* 新增申报单附件
*
* @param wornDeclareFile 申报单附件
* @return 结果
*/
public int insertWornDeclareFile(WornDeclareFile wornDeclareFile);
/**
* 修改申报单附件
*
* @param wornDeclareFile 申报单附件
* @return 结果
*/
public int updateWornDeclareFile(WornDeclareFile wornDeclareFile);
/**
* 批量删除申报单附件
*
* @param ids 需要删除的申报单附件主键集合
* @return 结果
*/
public int deleteWornDeclareFileByIds(Long[] ids);
/**
* 删除申报单附件信息
*
* @param id 申报单附件主键
* @return 结果
*/
public int deleteWornDeclareFileById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.shzg.project.worn.service;
import java.util.List;
import com.shzg.project.worn.domain.WornDeclareItem;
/**
* 申报单物料明细Service接口
*
* @author shzg
* @date 2026-04-14
*/
public interface IWornDeclareItemService
{
/**
* 查询申报单物料明细
*
* @param id 申报单物料明细主键
* @return 申报单物料明细
*/
public WornDeclareItem selectWornDeclareItemById(Long id);
/**
* 查询申报单物料明细列表
*
* @param wornDeclareItem 申报单物料明细
* @return 申报单物料明细集合
*/
public List<WornDeclareItem> selectWornDeclareItemList(WornDeclareItem wornDeclareItem);
/**
* 新增申报单物料明细
*
* @param wornDeclareItem 申报单物料明细
* @return 结果
*/
public int insertWornDeclareItem(WornDeclareItem wornDeclareItem);
/**
* 修改申报单物料明细
*
* @param wornDeclareItem 申报单物料明细
* @return 结果
*/
public int updateWornDeclareItem(WornDeclareItem wornDeclareItem);
/**
* 批量删除申报单物料明细
*
* @param ids 需要删除的申报单物料明细主键集合
* @return 结果
*/
public int deleteWornDeclareItemByIds(Long[] ids);
/**
* 删除申报单物料明细信息
*
* @param id 申报单物料明细主键
* @return 结果
*/
public int deleteWornDeclareItemById(Long id);
}

View File

@@ -4,6 +4,8 @@ import java.util.List;
import com.shzg.project.worn.domain.WornInboundBill;
import com.shzg.project.worn.domain.dto.WornInboundPartialFinishDTO;
import javax.servlet.http.HttpServletRequest;
/**
* 入库库存Service接口
*

View File

@@ -67,7 +67,7 @@ public interface IWornTechnicalAppraisalService
* @param wornTechnicalAppraisal 技术鉴定表
* @return 结果
*/
int insertWornTechnicalAppraisalWithFiles(WornTechnicalAppraisal wornTechnicalAppraisal);
WornTechnicalAppraisalSimpleDTO insertWornTechnicalAppraisalWithFiles(WornTechnicalAppraisal wornTechnicalAppraisal);
/**
* 查询我上传的技术鉴定表列表
*

View File

@@ -0,0 +1,669 @@
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.WornDeclareFile;
import com.shzg.project.worn.domain.WornDeclareItem;
import com.shzg.project.worn.mapper.WornDeclareFileMapper;
import com.shzg.project.worn.mapper.WornDeclareItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shzg.project.worn.mapper.WornDeclareBillMapper;
import com.shzg.project.worn.domain.WornDeclareBill;
import com.shzg.project.worn.service.IWornDeclareBillService;
import org.springframework.transaction.annotation.Transactional;
/**
* 申报单查看Service业务层处理
*
* @author shzg
* @date 2026-04-14
*/
@Service
public class WornDeclareBillServiceImpl implements IWornDeclareBillService
{
@Autowired
private WornDeclareBillMapper wornDeclareBillMapper;
@Autowired
private WornDeclareItemMapper wornDeclareItemMapper;
@Autowired
private WornDeclareFileMapper wornDeclareFileMapper;
@Autowired
private WornUniqueCodeMapper wornUniqueCodeMapper;
@Autowired
private WornUniqueCodeMaterialMapper wornUniqueCodeMaterialMapper;
@Autowired
private WornUniqueCodeEventMapper eventMapper;
/**
* 查询申报单查看
*
* @param id 申报单查看主键
* @return 申报单查看
*/
@Override
public WornDeclareBill selectWornDeclareBillById(Long id)
{
return wornDeclareBillMapper.selectWornDeclareBillById(id);
}
/**
* 查询申报单查看列表
*
* @param wornDeclareBill 申报单查看
* @return 申报单查看
*/
@Override
public List<WornDeclareBill> selectWornDeclareBillList(WornDeclareBill wornDeclareBill)
{
return wornDeclareBillMapper.selectWornDeclareBillList(wornDeclareBill);
}
/**
* 新增申报单查看
*
* @param wornDeclareBill 申报单查看
* @return 结果
*/
/**
* 新增申报单
*
* @param wornDeclareBill 申报单
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertWornDeclareBill(WornDeclareBill wornDeclareBill)
{
/* ================== 1. 参数校验 ================== */
if (wornDeclareBill == null)
{
throw new RuntimeException("申报单参数不能为空");
}
if (StringUtils.isEmpty(wornDeclareBill.getContactName()))
{
throw new RuntimeException("联系人不能为空");
}
if (StringUtils.isEmpty(wornDeclareBill.getContactPhone()))
{
throw new RuntimeException("联系电话不能为空");
}
if (StringUtils.isEmpty(wornDeclareBill.getDeliveryTime()))
{
throw new RuntimeException("交付时间不能为空");
}
if (StringUtils.isEmpty(wornDeclareBill.getAddress()))
{
throw new RuntimeException("存放地址不能为空");
}
if (wornDeclareBill.getItemList() == null || wornDeclareBill.getItemList().isEmpty())
{
throw new RuntimeException("申报单明细不能为空");
}
/* ================== 2. 当前用户 ================== */
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
Date now = DateUtils.getNowDate();
wornDeclareBill.setProjectId(deptId);
/* ================== 3. 主表赋值 ================== */
wornDeclareBill.setCreateTime(now);
wornDeclareBill.setCreateBy(String.valueOf(userId));
wornDeclareBill.setStatus("1"); // 1=已提交
wornDeclareBill.setIsDelete("0");
if (StringUtils.isEmpty(wornDeclareBill.getBillNo())){
wornDeclareBill.setBillNo("DR" + System.currentTimeMillis());
}
/* ================== 4. 插入主表 ================== */
int rows = wornDeclareBillMapper.insertWornDeclareBill(wornDeclareBill);
if (rows <= 0){
throw new RuntimeException("申报单新增失败");
}
Long billId = wornDeclareBill.getId();
String billNo = wornDeclareBill.getBillNo();
if (billId == null){
throw new RuntimeException("申报单新增失败ID未回填");
}
/* ================== 5. 插入明细 ================== */
List<WornDeclareItem> itemList = wornDeclareBill.getItemList();
for (WornDeclareItem item : itemList)
{
if (item == null)
{
continue;
}
item.setBillId(billId);
item.setBillNo(billNo);
item.setCreateTime(now);
item.setCreateBy(String.valueOf(userId));
item.setStatus("1"); // 1正常
item.setIsDelete("0");
int itemRows = wornDeclareItemMapper.insertWornDeclareItem(item);
if (itemRows <= 0)
{
throw new RuntimeException("申报单明细新增失败");
}
}
/* ================== 7. 插入附件 ================== */
List<WornDeclareFile> fileList = wornDeclareBill.getFileList();
if (fileList != null && !fileList.isEmpty()){
Long sortNum = 1L;
for (WornDeclareFile file : fileList){
if (file == null || StringUtils.isEmpty(file.getUrl())){
continue;
}
file.setBillId(billId);
file.setBillNo(billNo);
file.setSortNum(sortNum++);
file.setCreateBy(String.valueOf(userId));
file.setCreateTime(now);
file.setIsDelete("0");
file.setFileUrl(file.getUrl());
file.setFileName(file.getFileName());
String fileType = "";
if (StringUtils.isNotEmpty(file.getName()) && file.getName().contains(".")) {
fileType = file.getName().substring(file.getName().lastIndexOf(".") + 1).toLowerCase();
}
file.setFileType(fileType);
int fileRows = wornDeclareFileMapper.insertWornDeclareFile(file);
if (fileRows <= 0)
{
throw new RuntimeException("申报单附件新增失败:" + file.getFileName());
}
}
}
return 1;
}
@Override
public WornDeclareBill selectWornDeclareBillDetailByBillNo(String billNo)
{
if (StringUtils.isEmpty(billNo))
{
throw new RuntimeException("申报单号不能为空");
}
// 1. 查主表
WornDeclareBill bill = wornDeclareBillMapper.selectWornDeclareBillByBillNo(billNo);
if (bill == null)
{
throw new RuntimeException("申报单不存在");
}
// 2. 查明细
List<WornDeclareItem> itemList = wornDeclareItemMapper.selectWornDeclareItemDetailByBillNo(billNo);
bill.setItemList(itemList);
// 3. 查附件
List<WornDeclareFile> fileList = wornDeclareFileMapper.selectWornDeclareFileByBillId(bill.getId());
bill.setFileList(fileList);
return bill;
}
/**
* 修改申报单查看
*
* @param wornDeclareBill 申报单查看
* @return 结果
*/
/**
* 修改申报单
*
* @param wornDeclareBill 申报单
* @return 结果
*/
/**
* 修改申报单
*
* @param dto 申报单
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int updateWornDeclareBill(WornDeclareBill dto){
/* ================== 1. 参数校验 ================== */
if (dto == null)
{
throw new RuntimeException("申报单参数不能为空");
}
if (dto.getId() == null)
{
throw new RuntimeException("申报单ID不能为空");
}
if (StringUtils.isEmpty(dto.getBillNo()))
{
throw new RuntimeException("申报单号不能为空");
}
if (StringUtils.isEmpty(dto.getContactName()))
{
throw new RuntimeException("联系人不能为空");
}
if (StringUtils.isEmpty(dto.getContactPhone()))
{
throw new RuntimeException("联系电话不能为空");
}
if (StringUtils.isEmpty(dto.getDeliveryTime()))
{
throw new RuntimeException("交付时间不能为空");
}
if (StringUtils.isEmpty(dto.getAddress()))
{
throw new RuntimeException("存放地址不能为空");
}
/* ================== 2. 当前用户 ================== */
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
Date now = DateUtils.getNowDate();
/* ================== 3. 查询原单 ================== */
WornDeclareBill billUp = wornDeclareBillMapper.selectWornDeclareBillById(dto.getId());
if (billUp == null)
{
throw new RuntimeException("申报单不存在");
}
/* ================== 4. 更新主表 ================== */
billUp.setProjectId(deptId);
billUp.setContactName(dto.getContactName());
billUp.setContactPhone(dto.getContactPhone());
billUp.setDeliveryTime(dto.getDeliveryTime());
billUp.setAddress(dto.getAddress());
billUp.setRemark(dto.getRemark());
billUp.setUpdateBy(String.valueOf(userId));
billUp.setUpdateTime(now);
int rows = wornDeclareBillMapper.updateWornDeclareBill(billUp);
if (rows <= 0)
{
throw new RuntimeException("申报单修改失败");
}
/* ================== 5. 更新 / 新增 / 删除明细 ================== */
if (dto.getItemList() != null && !dto.getItemList().isEmpty()){
for (WornDeclareItem itemDTO : dto.getItemList()){
if (itemDTO == null){
continue;
}
// ===== 删除 =====
if ("1".equals(itemDTO.getIsDelete())){
if (itemDTO.getId() != null){
WornDeclareItem oldItem = wornDeclareItemMapper.selectWornDeclareItemById(itemDTO.getId());
if (oldItem != null)
{
oldItem.setIsDelete("1");
oldItem.setUpdateBy(String.valueOf(userId));
oldItem.setUpdateTime(now);
int deleteRows = wornDeclareItemMapper.updateWornDeclareItem(oldItem);
if (deleteRows <= 0)
{
throw new RuntimeException("申报单明细删除失败");
}
// // 删除时,如果有唯一码,再回滚
// if (oldItem.getUniqueCode() != null){
// rollbackDeclareUniqueCode(userId, oldItem.getUniqueCode().intValue(), now);
// }
}
}
continue;
}
// ===== 新增 =====
if (itemDTO.getId() == null){
WornDeclareItem newItem = new WornDeclareItem();
newItem.setBillId(billUp.getId());
newItem.setBillNo(billUp.getBillNo());
newItem.setMaterialId(itemDTO.getMaterialId());
newItem.setMaterialName(itemDTO.getMaterialName());
newItem.setMaterialCode(itemDTO.getMaterialCode());
newItem.setMaterialShortName(itemDTO.getMaterialShortName());
newItem.setSpecification(itemDTO.getSpecification());
newItem.setModel(itemDTO.getModel());
newItem.setTypeName(itemDTO.getTypeName());
newItem.setTypeParentNames(itemDTO.getTypeParentNames());
newItem.setUniqueCode(itemDTO.getUniqueCode());
newItem.setQuantity(itemDTO.getQuantity());
newItem.setUnitId(itemDTO.getUnitId());
newItem.setUnitName(itemDTO.getUnitName());
newItem.setRemark(itemDTO.getRemark());
newItem.setStatus("1");
newItem.setIsDelete("0");
newItem.setCreateBy(String.valueOf(userId));
newItem.setCreateTime(now);
int itemRows = wornDeclareItemMapper.insertWornDeclareItem(newItem);
if (itemRows <= 0)
{
throw new RuntimeException("申报单明细新增失败");
}
}else{
// ===== 修改 =====
WornDeclareItem oldItem = wornDeclareItemMapper.selectWornDeclareItemById(itemDTO.getId());
if (oldItem == null)
{
throw new RuntimeException("申报单明细不存在ID" + itemDTO.getId());
}
Integer newCode = 0;
if (itemDTO.getUniqueCode() !=null){
newCode = itemDTO.getUniqueCode().intValue();;
}
oldItem.setMaterialId(itemDTO.getMaterialId());
oldItem.setMaterialName(itemDTO.getMaterialName());
oldItem.setMaterialCode(itemDTO.getMaterialCode());
oldItem.setMaterialShortName(itemDTO.getMaterialShortName());
oldItem.setSpecification(itemDTO.getSpecification());
oldItem.setModel(itemDTO.getModel());
oldItem.setTypeName(itemDTO.getTypeName());
oldItem.setTypeParentNames(itemDTO.getTypeParentNames());
oldItem.setUniqueCode(newCode);
oldItem.setQuantity(itemDTO.getQuantity());
oldItem.setUnitId(itemDTO.getUnitId());
oldItem.setUnitName(itemDTO.getUnitName());
oldItem.setRemark(itemDTO.getRemark());
oldItem.setUpdateBy(String.valueOf(userId));
oldItem.setUpdateTime(now);
int itemRows = wornDeclareItemMapper.updateWornDeclareItem(oldItem);
if (itemRows <= 0)
{
throw new RuntimeException("申报单明细更新失败");
}
}
}
}
/* ================== 6. 处理附件 ================== */
// 这里先简单处理:删旧附件再重插
wornDeclareFileMapper.deleteWornDeclareFileByBillId(billUp.getId());
List<WornDeclareFile> fileList = dto.getFileList();
if (fileList != null && !fileList.isEmpty())
{
Long sortNum = 1L;
for (WornDeclareFile file : fileList){
if (file == null || StringUtils.isEmpty(file.getUrl()))
{
continue;
}
if (StringUtils.isEmpty(file.getName()))
{
file.setFileName("附件" + sortNum);
}
file.setBillId(billUp.getId());
file.setBillNo(billUp.getBillNo());
file.setSortNum(sortNum++);
file.setCreateBy(String.valueOf(userId));
file.setCreateTime(now);
file.setIsDelete("0");
file.setFileUrl(file.getUrl());
int fileRows = wornDeclareFileMapper.insertWornDeclareFile(file);
if (fileRows <= 0)
{
throw new RuntimeException("申报单附件保存失败:" + file.getFileName());
}
}
}
return 1;
}
// private void handleDeclareUniqueCode(Long userId, WornDeclareItem item, Date now, String billNo)
// {
// if (item == null || item.getUniqueCode() == null)
// {
// return;
// }
//
// Integer code = item.getUniqueCode().intValue();
//
// // 1. 查询唯一码是否存在
// Long uniqueId = wornUniqueCodeMapper.selectIdByCode(code);
// if (uniqueId == null)
// {
// throw new RuntimeException("唯一码不存在:" + code);
// }
//
// // 2. 同步唯一码物料表(保留)
// WornUniqueCodeMaterial material = new WornUniqueCodeMaterial();
// material.setUniqueCodeId(uniqueId);
// material.setMaterialId(item.getMaterialId());
//
// material.setQuantity(item.getQuantity());
// material.setUnitId(item.getUnitId());
// material.setRemark(item.getRemark());
// material.setIsDelete("0");
//
// WornUniqueCodeMaterial dbMaterial = wornUniqueCodeMaterialMapper.selectByUniqueCodeId(uniqueId);
// if (dbMaterial == null)
// {
// material.setCreateBy(String.valueOf(userId));
// material.setCreateTime(now);
//
// int materialRows = wornUniqueCodeMaterialMapper.insertWornUniqueCodeMaterial(material);
// if (materialRows <= 0)
// {
// throw new RuntimeException("唯一码物料表新增失败:" + code);
// }
// }
// else
// {
// material.setId(dbMaterial.getId());
// material.setUpdateBy(String.valueOf(userId));
// material.setUpdateTime(now);
//
// int materialRows = wornUniqueCodeMaterialMapper.updateWornUniqueCodeMaterial(material);
// if (materialRows <= 0)
// {
// throw new RuntimeException("唯一码物料表更新失败:" + code);
// }
// }
//
// // 3. 记录事件(保留)
// WornUniqueCodeEvent event = new WornUniqueCodeEvent();
// event.setUniqueCodeId(uniqueId);
// event.setEventType("2"); // 这里你自己按事件字典调整别和status混了
// event.setEventStatus("1");
// event.setEventDesc("生成/修改申报单:" + billNo);
// event.setOperatorId(userId);
// event.setCreateBy(String.valueOf(userId));
// event.setCreateTime(now);
// event.setIsDelete("0");
//
// int eventRows = eventMapper.insertWornUniqueCodeEvent(event);
// if (eventRows <= 0)
// {
// throw new RuntimeException("唯一码事件记录失败:" + code);
// }
// }
// /**
// * 回滚申报单唯一码状态
// */
// private void rollbackDeclareUniqueCode(Long userId, Integer code, Date now)
// {
// if (code == null)
// {
// return;
// }
//
//// // 1. 回滚唯一码状态
//// WornUniqueCode rollback = new WornUniqueCode();
//// rollback.setCode(code);
//// rollback.setStatus("0"); // 这里按你们实际状态改
//// rollback.setUpdateBy(String.valueOf(userId));
//// rollback.setUpdateTime(now);
////
//// int rollbackRows = wornUniqueCodeMapper.updateByCode(rollback);
//// if (rollbackRows <= 0)
//// {
//// throw new RuntimeException("唯一码状态回滚失败:" + code);
//// }
//
// // 2. 唯一码物料表逻辑删除
// Long uniqueId = wornUniqueCodeMapper.selectIdByCode(code);
// if (uniqueId != null)
// {
// wornUniqueCodeMaterialMapper.deleteByUniqueCodeId(uniqueId);
// }
// }
// /**
// * 唯一码不变时,只同步唯一码物料表,不改唯一码状态
// */
// private void syncDeclareUniqueCodeMaterialByCode(Long userId, Integer code, WornDeclareItem item, Date now)
// {
// if (code == null || item == null)
// {
// return;
// }
//
// Long uniqueId = wornUniqueCodeMapper.selectIdByCode(code);
// if (uniqueId == null)
// {
// throw new RuntimeException("唯一码不存在:" + code);
// }
//
// WornUniqueCodeMaterial dbMaterial = wornUniqueCodeMaterialMapper.selectByUniqueCodeId(uniqueId);
// if (dbMaterial == null)
// {
// WornUniqueCodeMaterial material = new WornUniqueCodeMaterial();
// material.setUniqueCodeId(uniqueId);
// material.setMaterialId(item.getMaterialId());
//
// material.setQuantity(item.getQuantity());
// material.setUnitId(item.getUnitId());
// material.setRemark(item.getRemark());
// material.setCreateBy(String.valueOf(userId));
// material.setCreateTime(now);
// material.setIsDelete("0");
//
// int rows = wornUniqueCodeMaterialMapper.insertWornUniqueCodeMaterial(material);
// if (rows <= 0)
// {
// throw new RuntimeException("唯一码物料表新增失败:" + code);
// }
// }
// else
// {
// WornUniqueCodeMaterial material = new WornUniqueCodeMaterial();
// material.setId(dbMaterial.getId());
// material.setUniqueCodeId(uniqueId);
// material.setMaterialId(item.getMaterialId());
//
// material.setQuantity(item.getQuantity());
// material.setUnitId(item.getUnitId());
// material.setRemark(item.getRemark());
// material.setUpdateBy(String.valueOf(userId));
// material.setUpdateTime(now);
// material.setIsDelete("0");
//
// int rows = wornUniqueCodeMaterialMapper.updateWornUniqueCodeMaterial(material);
// if (rows <= 0)
// {
// throw new RuntimeException("唯一码物料表更新失败:" + code);
// }
// }
// }
/**
* 批量删除申报单查看
*
* @param ids 需要删除的申报单查看主键
* @return 结果
*/
@Override
public int deleteWornDeclareBillByIds(Long[] ids)
{
return wornDeclareBillMapper.deleteWornDeclareBillByIds(ids);
}
/**
* 删除申报单查看信息
*
* @param id 申报单查看主键
* @return 结果
*/
@Override
public int deleteWornDeclareBillById(Long id)
{
return wornDeclareBillMapper.deleteWornDeclareBillById(id);
}
/**
* 作废申报单
*
* @param id 申报单ID
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int cancelWornDeclareBill(Long id)
{
if (id == null)
{
throw new RuntimeException("申报单ID不能为空");
}
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
Date now = DateUtils.getNowDate();
// 1. 查询主表
WornDeclareBill bill = wornDeclareBillMapper.selectWornDeclareBillById(id);
if (bill == null)
{
throw new RuntimeException("申报单不存在");
}
// 2. 重复作废校验
if ("9".equals(bill.getStatus()))
{
throw new RuntimeException("申报单已作废,请勿重复操作");
}
// 3. 主表作废
bill.setStatus("9");
bill.setUpdateBy(String.valueOf(userId));
bill.setUpdateTime(now);
int billRows = wornDeclareBillMapper.cancelWornDeclareBill(bill);
if (billRows <= 0)
{
throw new RuntimeException("申报单作废失败");
}
// 4. 明细作废
wornDeclareItemMapper.cancelWornDeclareItemByBillId(
id,
String.valueOf(userId),
now
);
return 1;
}
}

View File

@@ -0,0 +1,95 @@
package com.shzg.project.worn.service.impl;
import java.util.List;
import com.shzg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shzg.project.worn.mapper.WornDeclareFileMapper;
import com.shzg.project.worn.domain.WornDeclareFile;
import com.shzg.project.worn.service.IWornDeclareFileService;
/**
* 申报单附件Service业务层处理
*
* @author shzg
* @date 2026-04-14
*/
@Service
public class WornDeclareFileServiceImpl implements IWornDeclareFileService
{
@Autowired
private WornDeclareFileMapper wornDeclareFileMapper;
/**
* 查询申报单附件
*
* @param id 申报单附件主键
* @return 申报单附件
*/
@Override
public WornDeclareFile selectWornDeclareFileById(Long id)
{
return wornDeclareFileMapper.selectWornDeclareFileById(id);
}
/**
* 查询申报单附件列表
*
* @param wornDeclareFile 申报单附件
* @return 申报单附件
*/
@Override
public List<WornDeclareFile> selectWornDeclareFileList(WornDeclareFile wornDeclareFile)
{
return wornDeclareFileMapper.selectWornDeclareFileList(wornDeclareFile);
}
/**
* 新增申报单附件
*
* @param wornDeclareFile 申报单附件
* @return 结果
*/
@Override
public int insertWornDeclareFile(WornDeclareFile wornDeclareFile)
{
wornDeclareFile.setCreateTime(DateUtils.getNowDate());
return wornDeclareFileMapper.insertWornDeclareFile(wornDeclareFile);
}
/**
* 修改申报单附件
*
* @param wornDeclareFile 申报单附件
* @return 结果
*/
@Override
public int updateWornDeclareFile(WornDeclareFile wornDeclareFile)
{
return wornDeclareFileMapper.updateWornDeclareFile(wornDeclareFile);
}
/**
* 批量删除申报单附件
*
* @param ids 需要删除的申报单附件主键
* @return 结果
*/
@Override
public int deleteWornDeclareFileByIds(Long[] ids)
{
return wornDeclareFileMapper.deleteWornDeclareFileByIds(ids);
}
/**
* 删除申报单附件信息
*
* @param id 申报单附件主键
* @return 结果
*/
@Override
public int deleteWornDeclareFileById(Long id)
{
return wornDeclareFileMapper.deleteWornDeclareFileById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.shzg.project.worn.service.impl;
import java.util.List;
import com.shzg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shzg.project.worn.mapper.WornDeclareItemMapper;
import com.shzg.project.worn.domain.WornDeclareItem;
import com.shzg.project.worn.service.IWornDeclareItemService;
/**
* 申报单物料明细Service业务层处理
*
* @author shzg
* @date 2026-04-14
*/
@Service
public class WornDeclareItemServiceImpl implements IWornDeclareItemService
{
@Autowired
private WornDeclareItemMapper wornDeclareItemMapper;
/**
* 查询申报单物料明细
*
* @param id 申报单物料明细主键
* @return 申报单物料明细
*/
@Override
public WornDeclareItem selectWornDeclareItemById(Long id)
{
return wornDeclareItemMapper.selectWornDeclareItemById(id);
}
/**
* 查询申报单物料明细列表
*
* @param wornDeclareItem 申报单物料明细
* @return 申报单物料明细
*/
@Override
public List<WornDeclareItem> selectWornDeclareItemList(WornDeclareItem wornDeclareItem)
{
return wornDeclareItemMapper.selectWornDeclareItemList(wornDeclareItem);
}
/**
* 新增申报单物料明细
*
* @param wornDeclareItem 申报单物料明细
* @return 结果
*/
@Override
public int insertWornDeclareItem(WornDeclareItem wornDeclareItem)
{
wornDeclareItem.setCreateTime(DateUtils.getNowDate());
return wornDeclareItemMapper.insertWornDeclareItem(wornDeclareItem);
}
/**
* 修改申报单物料明细
*
* @param wornDeclareItem 申报单物料明细
* @return 结果
*/
@Override
public int updateWornDeclareItem(WornDeclareItem wornDeclareItem)
{
wornDeclareItem.setUpdateTime(DateUtils.getNowDate());
return wornDeclareItemMapper.updateWornDeclareItem(wornDeclareItem);
}
/**
* 批量删除申报单物料明细
*
* @param ids 需要删除的申报单物料明细主键
* @return 结果
*/
@Override
public int deleteWornDeclareItemByIds(Long[] ids)
{
return wornDeclareItemMapper.deleteWornDeclareItemByIds(ids);
}
/**
* 删除申报单物料明细信息
*
* @param id 申报单物料明细主键
* @return 结果
*/
@Override
public int deleteWornDeclareItemById(Long id)
{
return wornDeclareItemMapper.deleteWornDeclareItemById(id);
}
}

View File

@@ -629,7 +629,7 @@ public class WornInboundBillServiceImpl implements IWornInboundBillService
document.add(table);
document.close();
System.out.println("PDF生成成功字节长度" + out.size());
return out.toByteArray();
}

View File

@@ -13,13 +13,14 @@ 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.WornTechnicalAppraisal;
import com.shzg.project.worn.domain.WornTechnicalAppraisalFile;
import com.shzg.project.worn.domain.dto.AppraisalFileDTO;
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 com.shzg.project.worn.mapper.*;
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;
@@ -44,6 +45,10 @@ public class WornOutboundItemServiceImpl implements IWornOutboundItemService
private WornUniqueCodeMaterialMapper wornUniqueCodeMaterialMapper;
@Autowired
private WornOutboundBillMapper wornOutboundBillMapper;
@Autowired
private WornTechnicalAppraisalMapper wornTechnicalAppraisalMapper;
@Autowired
private WornTechnicalAppraisalFileMapper wornTechnicalAppraisalFileMapper;
/**
* 查询出库单明细
*
@@ -244,6 +249,12 @@ public class WornOutboundItemServiceImpl implements IWornOutboundItemService
{
return wornOutboundItemMapper.deleteWornOutboundItemById(id);
}
/**
* 查询出库单明细列表
*
* @param wornOutboundItem 出库单明细
* @return 出库单明细
*/
/**
* 查询出库单明细列表
*
@@ -259,7 +270,7 @@ public class WornOutboundItemServiceImpl implements IWornOutboundItemService
return null;
}
// 1. 查询明细列表
// 1. 查询出库单明细列表
WornOutboundItem param = new WornOutboundItem();
param.setBillNo(billNo);
@@ -316,8 +327,51 @@ public class WornOutboundItemServiceImpl implements IWornOutboundItemService
dto.setItemList(dtoList);
// 5. 查询技术鉴定表信息
WornTechnicalAppraisal appraisalQuery = new WornTechnicalAppraisal();
appraisalQuery.setBillNo(billNo);
List<WornTechnicalAppraisal> appraisalList =
wornTechnicalAppraisalMapper.selectWornTechnicalAppraisalList(appraisalQuery);
if (appraisalList != null && !appraisalList.isEmpty())
{
WornTechnicalAppraisal appraisal = appraisalList.get(0);
dto.setAppraisalId(appraisal.getId());
dto.setAppraisalNo(appraisal.getAppraisalNo());
dto.setAppraisalDesc(appraisal.getAppraisalDesc());
dto.setAppraisalRemark(appraisal.getRemark());
dto.setAppraisalTime(appraisal.getCreateTime());
// 查询鉴定表附件
List<WornTechnicalAppraisalFile> fileList =
wornTechnicalAppraisalFileMapper.selectWornTechnicalAppraisalFileByAppraisalId(appraisal.getId());
List<AppraisalFileDTO> appraisalFileList = 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());
appraisalFileList.add(fileDTO);
}
}
dto.setAppraisalFileList(appraisalFileList);
}
return dto;
}
/**
* 出库明细删除/替换时唯一码状态回滚3 -> 2
*/

View File

@@ -1,5 +1,6 @@
package com.shzg.project.worn.service.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -9,6 +10,7 @@ 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.FileUploadConfig;
import com.shzg.project.worn.domain.WornOutboundBill;
import com.shzg.project.worn.domain.WornTechnicalAppraisalFile;
import com.shzg.project.worn.domain.dto.AppraisalFileDTO;
@@ -37,6 +39,8 @@ public class WornTechnicalAppraisalServiceImpl implements IWornTechnicalAppraisa
private WornOutboundBillMapper wornOutboundBillMapper;
@Autowired
private WornTechnicalAppraisalFileMapper wornTechnicalAppraisalFileMapper;
@Autowired
private FileUploadConfig fileUploadConfig;
/**
* 查询技术鉴定
*
@@ -99,20 +103,117 @@ public class WornTechnicalAppraisalServiceImpl implements IWornTechnicalAppraisa
return wornTechnicalAppraisalMapper.deleteWornTechnicalAppraisalByIds(ids);
}
/**
* 删除技术鉴定信息
*
* @param id 技术鉴定主键
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteWornTechnicalAppraisalById(Long id)
{
return wornTechnicalAppraisalMapper.deleteWornTechnicalAppraisalById(id);
if (id == null)
{
throw new RuntimeException("技术鉴定表ID不能为空");
}
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
Date now = DateUtils.getNowDate();
/* ================== 1. 查询主表 ================== */
WornTechnicalAppraisal appraisal = wornTechnicalAppraisalMapper.selectWornTechnicalAppraisalById(id);
if (appraisal == null)
{
throw new RuntimeException("技术鉴定表不存在");
}
if ("1".equals(appraisal.getIsDelete()))
{
throw new RuntimeException("技术鉴定表已删除,请勿重复操作");
}
/* ================== 2. 查询附件 ================== */
List<WornTechnicalAppraisalFile> fileList =
wornTechnicalAppraisalFileMapper.selectWornTechnicalAppraisalFileByAppraisalId(id);
/* ================== 3. 删除物理文件 + 逻辑删除附件 ================== */
if (fileList != null && !fileList.isEmpty())
{
for (WornTechnicalAppraisalFile file : fileList)
{
if (file == null)
{
continue;
}
if (StringUtils.isNotEmpty(file.getFileUrl()))
{
deletePhysicalFile(file.getFileUrl());
}
WornTechnicalAppraisalFile updateFile = new WornTechnicalAppraisalFile();
updateFile.setId(file.getId());
updateFile.setIsDelete("1");
int fileRows = wornTechnicalAppraisalFileMapper.removeWornTechnicalAppraisalFileById(updateFile);
if (fileRows <= 0)
{
throw new RuntimeException("删除技术鉴定附件失败附件ID" + file.getId());
}
}
}
/* ================== 4. 逻辑删除主表 ================== */
WornTechnicalAppraisal updateAppraisal = new WornTechnicalAppraisal();
updateAppraisal.setId(id);
updateAppraisal.setIsDelete("1");
updateAppraisal.setUpdateBy(String.valueOf(userId));
updateAppraisal.setUpdateTime(now);
int rows = wornTechnicalAppraisalMapper.removeWornTechnicalAppraisalById(updateAppraisal);
if (rows <= 0)
{
throw new RuntimeException("删除技术鉴定表失败");
}
return 1;
}
/**
* 删除物理文件
*/
private void deletePhysicalFile(String fileUrl)
{
try
{
if (StringUtils.isEmpty(fileUrl))
{
return;
}
String uploadPath = fileUploadConfig.getUploadPath();
// 只处理 /profile/ 开头的路径
int index = fileUrl.indexOf("/profile/");
if (index < 0)
{
return;
}
String relativePath = fileUrl.substring(index + "/profile/".length());
File physicalFile = new File(uploadPath, relativePath);
if (physicalFile.exists() && physicalFile.isFile())
{
boolean deleted = physicalFile.delete();
if (!deleted)
{
throw new RuntimeException("物理文件删除失败:" + physicalFile.getAbsolutePath());
}
}
}
catch (Exception e)
{
throw new RuntimeException("删除物理文件失败:" + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public int insertWornTechnicalAppraisalWithFiles(WornTechnicalAppraisal wornTechnicalAppraisal)
public WornTechnicalAppraisalSimpleDTO insertWornTechnicalAppraisalWithFiles(WornTechnicalAppraisal wornTechnicalAppraisal)
{
/* ================== 1. 参数校验 ================== */
if (wornTechnicalAppraisal == null)
@@ -130,17 +231,21 @@ public class WornTechnicalAppraisalServiceImpl implements IWornTechnicalAppraisa
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
Date now = DateUtils.getNowDate();
/* ================== 3. 校验一张出库单只能有一张技术鉴定表 ================== */
/* ================== 3. 校验一 ================== */
WornTechnicalAppraisal query = new WornTechnicalAppraisal();
query.setBillNo(wornTechnicalAppraisal.getBillNo());
List<WornTechnicalAppraisal> oldList = wornTechnicalAppraisalMapper.selectWornTechnicalAppraisalList(query);
List<WornTechnicalAppraisal> oldList =
wornTechnicalAppraisalMapper.selectWornTechnicalAppraisalList(query);
if (oldList != null && !oldList.isEmpty())
{
throw new RuntimeException("该出库单已存在技术鉴定表,请勿重复新增");
}
/* ================== 4. 查询出库单(可选,但建议保留) ================== */
WornOutboundBill outboundBill = wornOutboundBillMapper.selectWornOutboundBillByBillNo(wornTechnicalAppraisal.getBillNo());
/* ================== 4. 查询出库单 ================== */
WornOutboundBill outboundBill =
wornOutboundBillMapper.selectWornOutboundBillByBillNo(wornTechnicalAppraisal.getBillNo());
if (outboundBill == null)
{
throw new RuntimeException("关联出库单不存在:" + wornTechnicalAppraisal.getBillNo());
@@ -168,38 +273,75 @@ public class WornTechnicalAppraisalServiceImpl implements IWornTechnicalAppraisa
}
Long appraisalId = wornTechnicalAppraisal.getId();
if (appraisalId == null)
{
throw new RuntimeException("技术鉴定表新增失败ID未回填");
}
/* ================== 6. 保存附件 ================== */
List<WornTechnicalAppraisalFile> fileList = wornTechnicalAppraisal.getFileList();
List<AppraisalFileDTO> fileList = wornTechnicalAppraisal.getFileList();
if (fileList != null && !fileList.isEmpty())
{
Long sortNum = 1L;
for (WornTechnicalAppraisalFile file : fileList)
{
if (file == null || StringUtils.isEmpty(file.getFileUrl()))
Long sortNum = 1L;
for (AppraisalFileDTO files : fileList){
if (files == null || StringUtils.isEmpty(files.getUrl()))
{
continue;
}
WornTechnicalAppraisalFile wornTechnicalAppraisalFile = new WornTechnicalAppraisalFile();
wornTechnicalAppraisalFile.setAppraisalId(appraisalId);
wornTechnicalAppraisalFile.setSortNum(sortNum++);
wornTechnicalAppraisalFile.setCreateBy(String.valueOf(userId));
wornTechnicalAppraisalFile.setCreateTime(now);
wornTechnicalAppraisalFile.setIsDelete("0");
wornTechnicalAppraisalFile.setFileName(files.getName());
wornTechnicalAppraisalFile.setFileUrl(files.getUrl());
String fileName = files.getName(); // 或从url截取
String fileType = "";
file.setAppraisalId(appraisalId);
file.setSortNum(sortNum++);
file.setCreateBy(String.valueOf(userId));
file.setCreateTime(now);
file.setIsDelete("0");
if (StringUtils.isNotEmpty(fileName) && fileName.contains(".")) {
fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
}
int fileRows = wornTechnicalAppraisalFileMapper.insertWornTechnicalAppraisalFile(file);
wornTechnicalAppraisalFile.setFileType(fileType);
int fileRows = wornTechnicalAppraisalFileMapper.insertWornTechnicalAppraisalFile(wornTechnicalAppraisalFile);
if (fileRows <= 0)
{
throw new RuntimeException("技术鉴定附件保存失败:" + file.getFileName());
throw new RuntimeException("附件保存失败:" + wornTechnicalAppraisalFile.getFileName());
}
}
}
return 1;
/* ================== 7. 组装返回 DTO ================== */
WornTechnicalAppraisal saved =
wornTechnicalAppraisalMapper.selectWornTechnicalAppraisalById(appraisalId);
List<WornTechnicalAppraisalFile> savedFiles =
wornTechnicalAppraisalFileMapper.selectWornTechnicalAppraisalFileByAppraisalId(appraisalId);
WornTechnicalAppraisalSimpleDTO dto = new WornTechnicalAppraisalSimpleDTO();
dto.setId(saved.getId());
dto.setAppraisalNo(saved.getAppraisalNo());
dto.setCreateTime(saved.getCreateTime());
dto.setAppraisalDesc(saved.getAppraisalDesc());
dto.setRemark(saved.getRemark());
List<AppraisalFileDTO> fileDtoList = new ArrayList<>();
if (savedFiles != null && !savedFiles.isEmpty())
{
for (WornTechnicalAppraisalFile file : savedFiles)
{
if (file == null) continue;
AppraisalFileDTO fileDTO = new AppraisalFileDTO();
fileDTO.setName(file.getFileName());
fileDTO.setUrl(file.getFileUrl());
fileDtoList.add(fileDTO);
}
}
dto.setFileUrlList(fileDtoList);
return dto;
}
@Override
public TableDataInfo selectMyTechnicalAppraisalSimplePageList()

View File

@@ -174,4 +174,17 @@
update_time = NOW()
WHERE unique_code_id = #{uniqueCodeId}
</update>
<select id="selectByUniqueCodeId" parameterType="Long" resultType="com.shzg.project.unique.domain.WornUniqueCodeMaterial">
select *
from worn_unique_code_material
where unique_code_id = #{uniqueCodeId}
and is_delete = '0'
limit 1
</select>
<update id="deleteByUniqueCodeId" parameterType="Long">
update worn_unique_code_material
set is_delete = '1'
where unique_code_id = #{uniqueCodeId}
and is_delete = '0'
</update>
</mapper>

View File

@@ -0,0 +1,137 @@
<?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.WornDeclareBillMapper">
<resultMap type="WornDeclareBill" id="WornDeclareBillResult">
<result property="id" column="id" />
<result property="billNo" column="bill_no" />
<result property="projectId" column="project_id" />
<result property="contactName" column="contact_name" />
<result property="contactPhone" column="contact_phone" />
<result property="deliveryTime" column="delivery_time" />
<result property="address" column="address" />
<result property="remark" column="remark" />
<result property="status" column="status" />
<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="selectWornDeclareBillVo">
select id, bill_no, project_id, contact_name, contact_phone, delivery_time, address, remark, status, create_by, create_time, update_by, update_time, is_delete from worn_declare_bill
</sql>
<select id="selectWornDeclareBillList" parameterType="WornDeclareBill" resultMap="WornDeclareBillResult">
<include refid="selectWornDeclareBillVo"/>
<where>
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="contactName != null and contactName != ''"> and contact_name like concat('%', #{contactName}, '%')</if>
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
<if test="deliveryTime != null "> and delivery_time = #{deliveryTime}</if>
<if test="address != null and address != ''"> and address = #{address}</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 or isDelete == ''">and is_delete = '0'</if>
</where>
order by create_time desc, id desc
</select>
<select id="selectWornDeclareBillById" parameterType="Long" resultMap="WornDeclareBillResult">
<include refid="selectWornDeclareBillVo"/>
where id = #{id}
</select>
<insert id="insertWornDeclareBill" parameterType="WornDeclareBill" useGeneratedKeys="true" keyProperty="id">
insert into worn_declare_bill
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billNo != null and billNo != ''">bill_no,</if>
<if test="projectId != null">project_id,</if>
<if test="contactName != null and contactName != ''">contact_name,</if>
<if test="contactPhone != null and contactPhone != ''">contact_phone,</if>
<if test="deliveryTime != null">delivery_time,</if>
<if test="address != null and address != ''">address,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="status != null and status != ''">status,</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="billNo != null and billNo != ''">#{billNo},</if>
<if test="projectId != null">#{projectId},</if>
<if test="contactName != null and contactName != ''">#{contactName},</if>
<if test="contactPhone != null and contactPhone != ''">#{contactPhone},</if>
<if test="deliveryTime != null">#{deliveryTime},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="status != null and status != ''">#{status},</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="updateWornDeclareBill" parameterType="WornDeclareBill">
update worn_declare_bill
<trim prefix="SET" suffixOverrides=",">
<if test="billNo != null and billNo != ''">bill_no = #{billNo},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="contactName != null">contact_name = #{contactName},</if>
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
<if test="deliveryTime != null">delivery_time = #{deliveryTime},</if>
<if test="address != null">address = #{address},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="status != null">status = #{status},</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="deleteWornDeclareBillById" parameterType="Long">
delete from worn_declare_bill where id = #{id}
</delete>
<delete id="deleteWornDeclareBillByIds" parameterType="String">
delete from worn_declare_bill where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectWornDeclareBillByBillNo" parameterType="String" resultMap="WornDeclareBillResult">
select id,
bill_no,
project_id,
contact_name,
contact_phone,
delivery_time,
address,
remark,
status,
create_by,
create_time,
update_by,
update_time,
is_delete
from worn_declare_bill
where bill_no = #{billNo}
and is_delete = '0'
limit 1
</select>
<update id="cancelWornDeclareBill" parameterType="com.shzg.project.worn.domain.WornDeclareBill">
update worn_declare_bill
set status = '9',
update_by = #{updateBy},
update_time = #{updateTime}
where id = #{id}
and is_delete = '0'
</update>
</mapper>

View File

@@ -0,0 +1,122 @@
<?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.WornDeclareFileMapper">
<resultMap type="WornDeclareFile" id="WornDeclareFileResult">
<result property="id" column="id" />
<result property="billId" column="bill_id" />
<result property="billNo" column="bill_no" />
<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="selectWornDeclareFileVo">
select id, bill_id, bill_no, file_name, file_url, file_type, sort_num, remark, create_by, create_time, is_delete from worn_declare_file
</sql>
<select id="selectWornDeclareFileList" parameterType="WornDeclareFile" resultMap="WornDeclareFileResult">
<include refid="selectWornDeclareFileVo"/>
<where>
<if test="billId != null "> and bill_id = #{billId}</if>
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</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="selectWornDeclareFileById" parameterType="Long" resultMap="WornDeclareFileResult">
<include refid="selectWornDeclareFileVo"/>
where id = #{id}
</select>
<insert id="insertWornDeclareFile" parameterType="WornDeclareFile" useGeneratedKeys="true" keyProperty="id">
insert into worn_declare_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billId != null">bill_id,</if>
<if test="billNo != null and billNo != ''">bill_no,</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="billId != null">#{billId},</if>
<if test="billNo != null and billNo != ''">#{billNo},</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="updateWornDeclareFile" parameterType="WornDeclareFile">
update worn_declare_file
<trim prefix="SET" suffixOverrides=",">
<if test="billId != null">bill_id = #{billId},</if>
<if test="billNo != null and billNo != ''">bill_no = #{billNo},</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="deleteWornDeclareFileById" parameterType="Long">
delete from worn_declare_file where id = #{id}
</delete>
<delete id="deleteWornDeclareFileByIds" parameterType="String">
delete from worn_declare_file where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectWornDeclareFileByBillId" parameterType="Long" resultMap="WornDeclareFileResult">
select id,
bill_id,
bill_no,
file_name,
file_url,
file_type,
sort_num,
remark,
create_by,
create_time,
is_delete
from worn_declare_file
where bill_id = #{billId}
and is_delete = '0'
order by sort_num asc, id asc
</select>
<update id="deleteWornDeclareFileByBillId" parameterType="Long">
update worn_declare_file
set is_delete = '1'
where bill_id = #{billId}
and is_delete = '0'
</update>
</mapper>

View File

@@ -0,0 +1,245 @@
<?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.WornDeclareItemMapper">
<resultMap id="WornDeclareItemResult" type="com.shzg.project.worn.domain.WornDeclareItem">
<!-- ===== 主键必须最前 ===== -->
<id property="id" column="id"/>
<!-- ===== 主表bill===== -->
<result property="billId" column="bill_id"/>
<result property="billNo" column="bill_no"/>
<result property="projectId" column="project_id"/>
<result property="contactName" column="contact_name"/>
<result property="contactPhone" column="contact_phone"/>
<result property="deliveryTime" column="delivery_time"/>
<result property="address" column="address"/>
<result property="billRemark" column="bill_remark"/>
<result property="billStatus" column="bill_status"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<!-- ===== 明细item===== -->
<result property="materialId" column="material_id"/>
<result property="quantity" column="quantity"/>
<result property="uniqueCode" column="unique_code"/>
<result property="remark" column="remark"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="status" column="status"/>
<!-- ===== 物料 ===== -->
<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="weight" column="weight"/>
<!-- ===== 单位 ===== -->
<result property="unitId" column="unit_id"/>
<result property="unitName" column="unit_name"/>
<!-- ===== 类型 ===== -->
<result property="typeName" column="type_name"/>
<result property="typeParentNames" column="type_parent_names"/>
</resultMap>
<sql id="selectWornDeclareItemVo">
select id, bill_id, bill_no, material_id, material_name, material_code, material_short_name, specification, model, type_name, type_parent_names, unique_code, quantity, unit_id, unit_name, remark, status, create_by, create_time, update_by, update_time, is_delete from worn_declare_item
</sql>
<select id="selectWornDeclareItemList" parameterType="WornDeclareItem" resultMap="WornDeclareItemResult">
<include refid="selectWornDeclareItemVo"/>
<where>
<if test="billId != null "> and bill_id = #{billId}</if>
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialShortName != null and materialShortName != ''"> and material_short_name like concat('%', #{materialShortName}, '%')</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="model != null and model != ''"> and model = #{model}</if>
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
<if test="typeParentNames != null and typeParentNames != ''"> and type_parent_names = #{typeParentNames}</if>
<if test="uniqueCode != null "> and unique_code = #{uniqueCode}</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="unitId != null "> and unit_id = #{unitId}</if>
<if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
</where>
</select>
<select id="selectWornDeclareItemById" parameterType="Long" resultMap="WornDeclareItemResult">
<include refid="selectWornDeclareItemVo"/>
where id = #{id}
</select>
<insert id="insertWornDeclareItem" parameterType="WornDeclareItem" useGeneratedKeys="true" keyProperty="id">
insert into worn_declare_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billId != null">bill_id,</if>
<if test="billNo != null and billNo != ''">bill_no,</if>
<if test="materialId != null">material_id,</if>
<if test="materialName != null and materialName != ''">material_name,</if>
<if test="materialCode != null and materialCode != ''">material_code,</if>
<if test="materialShortName != null and materialShortName != ''">material_short_name,</if>
<if test="specification != null and specification != ''">specification,</if>
<if test="model != null and model != ''">model,</if>
<if test="typeName != null and typeName != ''">type_name,</if>
<if test="typeParentNames != null and typeParentNames != ''">type_parent_names,</if>
<if test="uniqueCode != null">unique_code,</if>
<if test="quantity != null">quantity,</if>
<if test="unitId != null">unit_id,</if>
<if test="unitName != null and unitName != ''">unit_name,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="status != null and status != ''">status,</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="billId != null">#{billId},</if>
<if test="billNo != null and billNo != ''">#{billNo},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialName != null and materialName != ''">#{materialName},</if>
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
<if test="materialShortName != null and materialShortName != ''">#{materialShortName},</if>
<if test="specification != null and specification != ''">#{specification},</if>
<if test="model != null and model != ''">#{model},</if>
<if test="typeName != null and typeName != ''">#{typeName},</if>
<if test="typeParentNames != null and typeParentNames != ''">#{typeParentNames},</if>
<if test="uniqueCode != null">#{uniqueCode},</if>
<if test="quantity != null">#{quantity},</if>
<if test="unitId != null">#{unitId},</if>
<if test="unitName != null and unitName != ''">#{unitName},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="status != null and status != ''">#{status},</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="updateWornDeclareItem" parameterType="WornDeclareItem">
update worn_declare_item
<trim prefix="SET" suffixOverrides=",">
<if test="billId != null">bill_id = #{billId},</if>
<if test="billNo != null and billNo != ''">bill_no = #{billNo},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialShortName != null">material_short_name = #{materialShortName},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="model != null">model = #{model},</if>
<if test="typeName != null">type_name = #{typeName},</if>
<if test="typeParentNames != null">type_parent_names = #{typeParentNames},</if>
<if test="uniqueCode != null">unique_code = #{uniqueCode},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="unitId != null">unit_id = #{unitId},</if>
<if test="unitName != null">unit_name = #{unitName},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="status != null">status = #{status},</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="deleteWornDeclareItemById" parameterType="Long">
delete from worn_declare_item where id = #{id}
</delete>
<delete id="deleteWornDeclareItemByIds" parameterType="String">
delete from worn_declare_item where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectWornDeclareItemDetailByBillNo"
parameterType="String"
resultMap="WornDeclareItemResult">
SELECT
-- ===== 主表bill=====
b.id AS bill_id,
b.bill_no AS bill_no,
b.project_id,
b.contact_name,
b.contact_phone,
b.delivery_time,
b.address,
b.remark AS bill_remark,
b.status AS bill_status,
b.update_by,
b.update_time,
-- ===== 明细item=====
i.id AS id,
i.material_id,
i.quantity,
i.unique_code,
i.remark,
i.is_delete,
i.create_by,
i.create_time,
i.status,
-- ===== 物料material=====
m.material_name,
m.material_code,
m.material_short_name,
m.specification,
m.model,
m.weight,
m.unit_id,
mu.unit_name,
-- ===== 类型material_type=====
mt.type_name AS 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_declare_bill b
LEFT JOIN worn_declare_item i
ON b.id = i.bill_id
LEFT JOIN worn_material m
ON i.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 b.bill_no = #{billNo}
AND b.is_delete = '0'
AND (i.is_delete = '0' OR i.is_delete IS NULL)
ORDER BY i.id ASC
</select>
<update id="deleteWornDeclareItemByBillId">
update worn_declare_item
set is_delete = '1',
status = '9',
update_by = #{updateBy},
update_time = #{updateTime}
where bill_id = #{billId}
and is_delete = '0'
</update>
<update id="cancelWornDeclareItemByBillId">
update worn_declare_item
set status = '9',
update_by = #{updateBy},
update_time = #{updateTime}
where bill_id = #{billId}
and is_delete = '0'
</update>
</mapper>

View File

@@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
</where>
order by create_time desc, id desc
</select>
<select id="selectWornOutboundBillById" parameterType="Long" resultMap="WornOutboundBillResult">

View File

@@ -90,9 +90,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<update id="removeWornTechnicalAppraisalFileById" parameterType="WornTechnicalAppraisalFile">
update worn_technical_appraisal_file
set is_delete = #{isDelete}
where id = #{id}
</update>
<select id="selectWornTechnicalAppraisalFileByAppraisalId"
parameterType="java.lang.Long"
resultType="com.shzg.project.worn.domain.WornTechnicalAppraisalFile">
resultMap="WornTechnicalAppraisalFileResult">
SELECT
id,

View File

@@ -43,10 +43,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by id desc
</select>
<select id="selectWornTechnicalAppraisalById" parameterType="Long" resultMap="WornTechnicalAppraisalResult">
<include refid="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
where id = #{id}
and (is_delete = '0' or is_delete is null)
limit 1
</select>
<insert id="insertWornTechnicalAppraisal" parameterType="WornTechnicalAppraisal" useGeneratedKeys="true" keyProperty="id">
@@ -102,7 +120,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
<update id="removeWornTechnicalAppraisalById" parameterType="WornTechnicalAppraisal">
update worn_technical_appraisal
set is_delete = #{isDelete},
update_by = #{updateBy},
update_time = #{updateTime}
where id = #{id}
</update>
<delete id="deleteWornTechnicalAppraisalById" parameterType="Long">
delete from worn_technical_appraisal where id = #{id}
</delete>