唯一码模块开发2.0包含事件、物料和数据隔离
This commit is contained in:
13
pom.xml
13
pom.xml
@@ -268,6 +268,19 @@
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 二维码 -->
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>javase</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.shzg.project.unique.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.shzg.framework.aspectj.lang.annotation.DataScope;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -37,6 +39,7 @@ public class WornUniqueCodeController extends BaseController
|
||||
/**
|
||||
* 查询唯一码管理列表
|
||||
*/
|
||||
@DataScope(deptAlias = "d")
|
||||
@PreAuthorize("@ss.hasPermi('unique:code:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WornUniqueCode wornUniqueCode)
|
||||
@@ -44,6 +47,7 @@ public class WornUniqueCodeController extends BaseController
|
||||
startPage();
|
||||
List<WornUniqueCode> list = wornUniqueCodeService.selectWornUniqueCodeList(wornUniqueCode);
|
||||
return getDataTable(list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.shzg.project.unique.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.unique.domain.WornUniqueCodeEvent;
|
||||
import com.shzg.project.unique.service.IWornUniqueCodeEventService;
|
||||
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-03-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/unique/event")
|
||||
public class WornUniqueCodeEventController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWornUniqueCodeEventService wornUniqueCodeEventService;
|
||||
|
||||
/**
|
||||
* 查询唯一码事件记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:event:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WornUniqueCodeEvent wornUniqueCodeEvent)
|
||||
{
|
||||
startPage();
|
||||
List<WornUniqueCodeEvent> list = wornUniqueCodeEventService.selectWornUniqueCodeEventList(wornUniqueCodeEvent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出唯一码事件记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:event:export')")
|
||||
@Log(title = "唯一码事件记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WornUniqueCodeEvent wornUniqueCodeEvent)
|
||||
{
|
||||
List<WornUniqueCodeEvent> list = wornUniqueCodeEventService.selectWornUniqueCodeEventList(wornUniqueCodeEvent);
|
||||
ExcelUtil<WornUniqueCodeEvent> util = new ExcelUtil<WornUniqueCodeEvent>(WornUniqueCodeEvent.class);
|
||||
util.exportExcel(response, list, "唯一码事件记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取唯一码事件记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:event:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wornUniqueCodeEventService.selectWornUniqueCodeEventById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增唯一码事件记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:event:add')")
|
||||
@Log(title = "唯一码事件记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WornUniqueCodeEvent wornUniqueCodeEvent)
|
||||
{
|
||||
return toAjax(wornUniqueCodeEventService.insertWornUniqueCodeEvent(wornUniqueCodeEvent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改唯一码事件记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:event:edit')")
|
||||
@Log(title = "唯一码事件记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WornUniqueCodeEvent wornUniqueCodeEvent)
|
||||
{
|
||||
return toAjax(wornUniqueCodeEventService.updateWornUniqueCodeEvent(wornUniqueCodeEvent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除唯一码事件记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:event:remove')")
|
||||
@Log(title = "唯一码事件记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wornUniqueCodeEventService.deleteWornUniqueCodeEventByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.shzg.project.unique.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.unique.domain.WornUniqueCodeMaterial;
|
||||
import com.shzg.project.unique.service.IWornUniqueCodeMaterialService;
|
||||
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-03-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/unique/information")
|
||||
public class WornUniqueCodeMaterialController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWornUniqueCodeMaterialService wornUniqueCodeMaterialService;
|
||||
|
||||
/**
|
||||
* 查询唯一码物料信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:information:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WornUniqueCodeMaterial wornUniqueCodeMaterial)
|
||||
{
|
||||
startPage();
|
||||
List<WornUniqueCodeMaterial> list = wornUniqueCodeMaterialService.selectWornUniqueCodeMaterialList(wornUniqueCodeMaterial);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出唯一码物料信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:information:export')")
|
||||
@Log(title = "唯一码物料信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WornUniqueCodeMaterial wornUniqueCodeMaterial)
|
||||
{
|
||||
List<WornUniqueCodeMaterial> list = wornUniqueCodeMaterialService.selectWornUniqueCodeMaterialList(wornUniqueCodeMaterial);
|
||||
ExcelUtil<WornUniqueCodeMaterial> util = new ExcelUtil<WornUniqueCodeMaterial>(WornUniqueCodeMaterial.class);
|
||||
util.exportExcel(response, list, "唯一码物料信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取唯一码物料信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:information:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wornUniqueCodeMaterialService.selectWornUniqueCodeMaterialById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增唯一码物料信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:information:add')")
|
||||
@Log(title = "唯一码物料信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WornUniqueCodeMaterial wornUniqueCodeMaterial)
|
||||
{
|
||||
return toAjax(wornUniqueCodeMaterialService.insertWornUniqueCodeMaterial(wornUniqueCodeMaterial));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改唯一码物料信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:information:edit')")
|
||||
@Log(title = "唯一码物料信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WornUniqueCodeMaterial wornUniqueCodeMaterial)
|
||||
{
|
||||
return toAjax(wornUniqueCodeMaterialService.updateWornUniqueCodeMaterial(wornUniqueCodeMaterial));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除唯一码物料信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('unique:information:remove')")
|
||||
@Log(title = "唯一码物料信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wornUniqueCodeMaterialService.deleteWornUniqueCodeMaterialByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ 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_unique_code
|
||||
*
|
||||
@@ -27,7 +29,7 @@ public class WornUniqueCode extends BaseEntity
|
||||
private String billNo;
|
||||
|
||||
/** 项目ID(用于数据隔离,对应sys_dept.id) */
|
||||
@Excel(name = "项目ID", readConverterExp = "用=于数据隔离,对应sys_dept.id")
|
||||
@Excel(name = "项目ID", readConverterExp = "用于数据隔离,对应sys_dept.id")
|
||||
private Long projectId;
|
||||
|
||||
/** 当前状态(0已生成 1已打印 2已入库 3已出库 4已配送) */
|
||||
@@ -46,19 +48,27 @@ public class WornUniqueCode extends BaseEntity
|
||||
@Excel(name = "是否删除", readConverterExp = "0=正常,1=删除")
|
||||
private String isDelete;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
/** ==================== 扩展字段(不落库) ==================== */
|
||||
|
||||
/** 物料信息(1条) */
|
||||
private WornUniqueCodeMaterial material;
|
||||
|
||||
/** 事件列表(多条) */
|
||||
private List<WornUniqueCodeEvent> eventList;
|
||||
|
||||
/** 二维码(base64) */
|
||||
private String qrCode;
|
||||
|
||||
/** ==================== getter / setter ==================== */
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setCode(String code)
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.code = code;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
@@ -66,9 +76,9 @@ public class WornUniqueCode extends BaseEntity
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setBillNo(String billNo)
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.billNo = billNo;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getBillNo()
|
||||
@@ -76,9 +86,9 @@ public class WornUniqueCode extends BaseEntity
|
||||
return billNo;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId)
|
||||
public void setBillNo(String billNo)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
this.billNo = billNo;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
@@ -86,9 +96,9 @@ public class WornUniqueCode extends BaseEntity
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.status = status;
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
@@ -96,9 +106,9 @@ public class WornUniqueCode extends BaseEntity
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setRfidCode(String rfidCode)
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.rfidCode = rfidCode;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRfidCode()
|
||||
@@ -106,9 +116,9 @@ public class WornUniqueCode extends BaseEntity
|
||||
return rfidCode;
|
||||
}
|
||||
|
||||
public void setPrintCount(Long printCount)
|
||||
public void setRfidCode(String rfidCode)
|
||||
{
|
||||
this.printCount = printCount;
|
||||
this.rfidCode = rfidCode;
|
||||
}
|
||||
|
||||
public Long getPrintCount()
|
||||
@@ -116,9 +126,9 @@ public class WornUniqueCode extends BaseEntity
|
||||
return printCount;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
public void setPrintCount(Long printCount)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
this.printCount = printCount;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
@@ -126,22 +136,61 @@ public class WornUniqueCode extends BaseEntity
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public WornUniqueCodeMaterial getMaterial()
|
||||
{
|
||||
return material;
|
||||
}
|
||||
|
||||
public void setMaterial(WornUniqueCodeMaterial material)
|
||||
{
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
public List<WornUniqueCodeEvent> getEventList()
|
||||
{
|
||||
return eventList;
|
||||
}
|
||||
|
||||
public void setEventList(List<WornUniqueCodeEvent> eventList)
|
||||
{
|
||||
this.eventList = eventList;
|
||||
}
|
||||
|
||||
public String getQrCode()
|
||||
{
|
||||
return qrCode;
|
||||
}
|
||||
|
||||
public void setQrCode(String qrCode)
|
||||
{
|
||||
this.qrCode = qrCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("billNo", getBillNo())
|
||||
.append("projectId", getProjectId())
|
||||
.append("status", getStatus())
|
||||
.append("rfidCode", getRfidCode())
|
||||
.append("printCount", getPrintCount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("billNo", getBillNo())
|
||||
.append("projectId", getProjectId())
|
||||
.append("status", getStatus())
|
||||
.append("rfidCode", getRfidCode())
|
||||
.append("printCount", getPrintCount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("material", getMaterial())
|
||||
.append("eventList", getEventList())
|
||||
.append("qrCode", getQrCode())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package com.shzg.project.unique.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_unique_code_event
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
public class WornUniqueCodeEvent extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 唯一码ID */
|
||||
@Excel(name = "唯一码ID")
|
||||
private Long uniqueCodeId;
|
||||
|
||||
/** 事件类型(0生成 1打印 2入库 3出库 4配送) */
|
||||
@Excel(name = "事件类型", readConverterExp = "0=生成,1=打印,2=入库,3=出库,4=配送")
|
||||
private String eventType;
|
||||
|
||||
/** 事件状态 */
|
||||
@Excel(name = "事件状态")
|
||||
private String eventStatus;
|
||||
|
||||
/** 事件描述 */
|
||||
@Excel(name = "事件描述")
|
||||
private String eventDesc;
|
||||
|
||||
/** 操作人ID */
|
||||
@Excel(name = "操作人ID")
|
||||
private Long operatorId;
|
||||
|
||||
/** 操作人名称 */
|
||||
@Excel(name = "操作人名称")
|
||||
private String operatorName;
|
||||
|
||||
/** 是否删除(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 setUniqueCodeId(Long uniqueCodeId)
|
||||
{
|
||||
this.uniqueCodeId = uniqueCodeId;
|
||||
}
|
||||
|
||||
public Long getUniqueCodeId()
|
||||
{
|
||||
return uniqueCodeId;
|
||||
}
|
||||
|
||||
public void setEventType(String eventType)
|
||||
{
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
|
||||
public void setEventStatus(String eventStatus)
|
||||
{
|
||||
this.eventStatus = eventStatus;
|
||||
}
|
||||
|
||||
public String getEventStatus()
|
||||
{
|
||||
return eventStatus;
|
||||
}
|
||||
|
||||
public void setEventDesc(String eventDesc)
|
||||
{
|
||||
this.eventDesc = eventDesc;
|
||||
}
|
||||
|
||||
public String getEventDesc()
|
||||
{
|
||||
return eventDesc;
|
||||
}
|
||||
|
||||
public void setOperatorId(Long operatorId)
|
||||
{
|
||||
this.operatorId = operatorId;
|
||||
}
|
||||
|
||||
public Long getOperatorId()
|
||||
{
|
||||
return operatorId;
|
||||
}
|
||||
|
||||
public void setOperatorName(String operatorName)
|
||||
{
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public String getOperatorName()
|
||||
{
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
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("uniqueCodeId", getUniqueCodeId())
|
||||
.append("eventType", getEventType())
|
||||
.append("eventStatus", getEventStatus())
|
||||
.append("eventDesc", getEventDesc())
|
||||
.append("operatorId", getOperatorId())
|
||||
.append("operatorName", getOperatorName())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.shzg.project.unique.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
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_unique_code_material
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
public class WornUniqueCodeMaterial extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 唯一码ID */
|
||||
@Excel(name = "唯一码ID")
|
||||
private Long uniqueCodeId;
|
||||
|
||||
/** 物料ID(对应worn_material.id) */
|
||||
@Excel(name = "物料ID", readConverterExp = "对=应worn_material.id")
|
||||
private Long materialId;
|
||||
|
||||
/** 单位ID(对应worn_material_unit.id) */
|
||||
@Excel(name = "单位ID", readConverterExp = "对=应worn_material_unit.id")
|
||||
private Long unitId;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 是否删除(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 setUniqueCodeId(Long uniqueCodeId)
|
||||
{
|
||||
this.uniqueCodeId = uniqueCodeId;
|
||||
}
|
||||
|
||||
public Long getUniqueCodeId()
|
||||
{
|
||||
return uniqueCodeId;
|
||||
}
|
||||
|
||||
public void setMaterialId(Long materialId)
|
||||
{
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public Long getMaterialId()
|
||||
{
|
||||
return materialId;
|
||||
}
|
||||
|
||||
public void setUnitId(Long unitId)
|
||||
{
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public Long getUnitId()
|
||||
{
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
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("uniqueCodeId", getUniqueCodeId())
|
||||
.append("materialId", getMaterialId())
|
||||
.append("unitId", getUnitId())
|
||||
.append("quantity", getQuantity())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.shzg.project.unique.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeEvent;
|
||||
|
||||
/**
|
||||
* 唯一码事件记录Mapper接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
public interface WornUniqueCodeEventMapper
|
||||
{
|
||||
/**
|
||||
* 查询唯一码事件记录
|
||||
*
|
||||
* @param id 唯一码事件记录主键
|
||||
* @return 唯一码事件记录
|
||||
*/
|
||||
public WornUniqueCodeEvent selectWornUniqueCodeEventById(Long id);
|
||||
|
||||
/**
|
||||
* 查询唯一码事件记录列表
|
||||
*
|
||||
* @param wornUniqueCodeEvent 唯一码事件记录
|
||||
* @return 唯一码事件记录集合
|
||||
*/
|
||||
public List<WornUniqueCodeEvent> selectWornUniqueCodeEventList(WornUniqueCodeEvent wornUniqueCodeEvent);
|
||||
|
||||
/**
|
||||
* 新增唯一码事件记录
|
||||
*
|
||||
* @param wornUniqueCodeEvent 唯一码事件记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornUniqueCodeEvent(WornUniqueCodeEvent wornUniqueCodeEvent);
|
||||
|
||||
/**
|
||||
* 修改唯一码事件记录
|
||||
*
|
||||
* @param wornUniqueCodeEvent 唯一码事件记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornUniqueCodeEvent(WornUniqueCodeEvent wornUniqueCodeEvent);
|
||||
|
||||
/**
|
||||
* 删除唯一码事件记录
|
||||
*
|
||||
* @param id 唯一码事件记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeEventById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除唯一码事件记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeEventByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据唯一码id查询唯一码事件记录
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<WornUniqueCodeEvent> selectByUniqueCodeId(Long id);
|
||||
}
|
||||
@@ -43,13 +43,6 @@ public interface WornUniqueCodeMapper
|
||||
*/
|
||||
public int updateWornUniqueCode(WornUniqueCode wornUniqueCode);
|
||||
|
||||
/**
|
||||
* 删除唯一码管理
|
||||
*
|
||||
* @param id 唯一码管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除唯一码管理
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.shzg.project.unique.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeMaterial;
|
||||
|
||||
/**
|
||||
* 唯一码物料信息Mapper接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
public interface WornUniqueCodeMaterialMapper
|
||||
{
|
||||
/**
|
||||
* 查询唯一码物料信息
|
||||
*
|
||||
* @param id 唯一码物料信息主键
|
||||
* @return 唯一码物料信息
|
||||
*/
|
||||
public WornUniqueCodeMaterial selectWornUniqueCodeMaterialById(Long id);
|
||||
|
||||
/**
|
||||
* 查询唯一码物料信息列表
|
||||
*
|
||||
* @param wornUniqueCodeMaterial 唯一码物料信息
|
||||
* @return 唯一码物料信息集合
|
||||
*/
|
||||
public List<WornUniqueCodeMaterial> selectWornUniqueCodeMaterialList(WornUniqueCodeMaterial wornUniqueCodeMaterial);
|
||||
|
||||
/**
|
||||
* 新增唯一码物料信息
|
||||
*
|
||||
* @param wornUniqueCodeMaterial 唯一码物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornUniqueCodeMaterial(WornUniqueCodeMaterial wornUniqueCodeMaterial);
|
||||
|
||||
/**
|
||||
* 修改唯一码物料信息
|
||||
*
|
||||
* @param wornUniqueCodeMaterial 唯一码物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornUniqueCodeMaterial(WornUniqueCodeMaterial wornUniqueCodeMaterial);
|
||||
|
||||
/**
|
||||
* 删除唯一码物料信息
|
||||
*
|
||||
* @param id 唯一码物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeMaterialById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除唯一码物料信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeMaterialByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据唯一码id查询唯一码物料信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
WornUniqueCodeMaterial selectByUniqueCodeId(Long id);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.shzg.project.unique.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeEvent;
|
||||
|
||||
/**
|
||||
* 唯一码事件记录Service接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
public interface IWornUniqueCodeEventService
|
||||
{
|
||||
/**
|
||||
* 查询唯一码事件记录
|
||||
*
|
||||
* @param id 唯一码事件记录主键
|
||||
* @return 唯一码事件记录
|
||||
*/
|
||||
public WornUniqueCodeEvent selectWornUniqueCodeEventById(Long id);
|
||||
|
||||
/**
|
||||
* 查询唯一码事件记录列表
|
||||
*
|
||||
* @param wornUniqueCodeEvent 唯一码事件记录
|
||||
* @return 唯一码事件记录集合
|
||||
*/
|
||||
public List<WornUniqueCodeEvent> selectWornUniqueCodeEventList(WornUniqueCodeEvent wornUniqueCodeEvent);
|
||||
|
||||
/**
|
||||
* 新增唯一码事件记录
|
||||
*
|
||||
* @param wornUniqueCodeEvent 唯一码事件记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornUniqueCodeEvent(WornUniqueCodeEvent wornUniqueCodeEvent);
|
||||
|
||||
/**
|
||||
* 修改唯一码事件记录
|
||||
*
|
||||
* @param wornUniqueCodeEvent 唯一码事件记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornUniqueCodeEvent(WornUniqueCodeEvent wornUniqueCodeEvent);
|
||||
|
||||
/**
|
||||
* 批量删除唯一码事件记录
|
||||
*
|
||||
* @param ids 需要删除的唯一码事件记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeEventByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除唯一码事件记录信息
|
||||
*
|
||||
* @param id 唯一码事件记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeEventById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.shzg.project.unique.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeMaterial;
|
||||
|
||||
/**
|
||||
* 唯一码物料信息Service接口
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
public interface IWornUniqueCodeMaterialService
|
||||
{
|
||||
/**
|
||||
* 查询唯一码物料信息
|
||||
*
|
||||
* @param id 唯一码物料信息主键
|
||||
* @return 唯一码物料信息
|
||||
*/
|
||||
public WornUniqueCodeMaterial selectWornUniqueCodeMaterialById(Long id);
|
||||
|
||||
/**
|
||||
* 查询唯一码物料信息列表
|
||||
*
|
||||
* @param wornUniqueCodeMaterial 唯一码物料信息
|
||||
* @return 唯一码物料信息集合
|
||||
*/
|
||||
public List<WornUniqueCodeMaterial> selectWornUniqueCodeMaterialList(WornUniqueCodeMaterial wornUniqueCodeMaterial);
|
||||
|
||||
/**
|
||||
* 新增唯一码物料信息
|
||||
*
|
||||
* @param wornUniqueCodeMaterial 唯一码物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWornUniqueCodeMaterial(WornUniqueCodeMaterial wornUniqueCodeMaterial);
|
||||
|
||||
/**
|
||||
* 修改唯一码物料信息
|
||||
*
|
||||
* @param wornUniqueCodeMaterial 唯一码物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWornUniqueCodeMaterial(WornUniqueCodeMaterial wornUniqueCodeMaterial);
|
||||
|
||||
/**
|
||||
* 批量删除唯一码物料信息
|
||||
*
|
||||
* @param ids 需要删除的唯一码物料信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeMaterialByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除唯一码物料信息信息
|
||||
*
|
||||
* @param id 唯一码物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeMaterialById(Long id);
|
||||
}
|
||||
@@ -51,11 +51,4 @@ public interface IWornUniqueCodeService
|
||||
*/
|
||||
public int deleteWornUniqueCodeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除唯一码管理信息
|
||||
*
|
||||
* @param id 唯一码管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWornUniqueCodeById(Long id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.shzg.project.unique.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.unique.mapper.WornUniqueCodeEventMapper;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeEvent;
|
||||
import com.shzg.project.unique.service.IWornUniqueCodeEventService;
|
||||
|
||||
/**
|
||||
* 唯一码事件记录Service业务层处理
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
@Service
|
||||
public class WornUniqueCodeEventServiceImpl implements IWornUniqueCodeEventService
|
||||
{
|
||||
@Autowired
|
||||
private WornUniqueCodeEventMapper wornUniqueCodeEventMapper;
|
||||
|
||||
/**
|
||||
* 查询唯一码事件记录
|
||||
*
|
||||
* @param id 唯一码事件记录主键
|
||||
* @return 唯一码事件记录
|
||||
*/
|
||||
@Override
|
||||
public WornUniqueCodeEvent selectWornUniqueCodeEventById(Long id)
|
||||
{
|
||||
return wornUniqueCodeEventMapper.selectWornUniqueCodeEventById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询唯一码事件记录列表
|
||||
*
|
||||
* @param wornUniqueCodeEvent 唯一码事件记录
|
||||
* @return 唯一码事件记录
|
||||
*/
|
||||
@Override
|
||||
public List<WornUniqueCodeEvent> selectWornUniqueCodeEventList(WornUniqueCodeEvent wornUniqueCodeEvent)
|
||||
{
|
||||
return wornUniqueCodeEventMapper.selectWornUniqueCodeEventList(wornUniqueCodeEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增唯一码事件记录
|
||||
*
|
||||
* @param wornUniqueCodeEvent 唯一码事件记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWornUniqueCodeEvent(WornUniqueCodeEvent wornUniqueCodeEvent)
|
||||
{
|
||||
wornUniqueCodeEvent.setCreateTime(DateUtils.getNowDate());
|
||||
return wornUniqueCodeEventMapper.insertWornUniqueCodeEvent(wornUniqueCodeEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改唯一码事件记录
|
||||
*
|
||||
* @param wornUniqueCodeEvent 唯一码事件记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWornUniqueCodeEvent(WornUniqueCodeEvent wornUniqueCodeEvent)
|
||||
{
|
||||
wornUniqueCodeEvent.setUpdateTime(DateUtils.getNowDate());
|
||||
return wornUniqueCodeEventMapper.updateWornUniqueCodeEvent(wornUniqueCodeEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除唯一码事件记录
|
||||
*
|
||||
* @param ids 需要删除的唯一码事件记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornUniqueCodeEventByIds(Long[] ids)
|
||||
{
|
||||
return wornUniqueCodeEventMapper.deleteWornUniqueCodeEventByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除唯一码事件记录信息
|
||||
*
|
||||
* @param id 唯一码事件记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornUniqueCodeEventById(Long id)
|
||||
{
|
||||
return wornUniqueCodeEventMapper.deleteWornUniqueCodeEventById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.shzg.project.unique.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.unique.mapper.WornUniqueCodeMaterialMapper;
|
||||
import com.shzg.project.unique.domain.WornUniqueCodeMaterial;
|
||||
import com.shzg.project.unique.service.IWornUniqueCodeMaterialService;
|
||||
|
||||
/**
|
||||
* 唯一码物料信息Service业务层处理
|
||||
*
|
||||
* @author shzg
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
@Service
|
||||
public class WornUniqueCodeMaterialServiceImpl implements IWornUniqueCodeMaterialService
|
||||
{
|
||||
@Autowired
|
||||
private WornUniqueCodeMaterialMapper wornUniqueCodeMaterialMapper;
|
||||
|
||||
/**
|
||||
* 查询唯一码物料信息
|
||||
*
|
||||
* @param id 唯一码物料信息主键
|
||||
* @return 唯一码物料信息
|
||||
*/
|
||||
@Override
|
||||
public WornUniqueCodeMaterial selectWornUniqueCodeMaterialById(Long id)
|
||||
{
|
||||
return wornUniqueCodeMaterialMapper.selectWornUniqueCodeMaterialById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询唯一码物料信息列表
|
||||
*
|
||||
* @param wornUniqueCodeMaterial 唯一码物料信息
|
||||
* @return 唯一码物料信息
|
||||
*/
|
||||
@Override
|
||||
public List<WornUniqueCodeMaterial> selectWornUniqueCodeMaterialList(WornUniqueCodeMaterial wornUniqueCodeMaterial)
|
||||
{
|
||||
return wornUniqueCodeMaterialMapper.selectWornUniqueCodeMaterialList(wornUniqueCodeMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增唯一码物料信息
|
||||
*
|
||||
* @param wornUniqueCodeMaterial 唯一码物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWornUniqueCodeMaterial(WornUniqueCodeMaterial wornUniqueCodeMaterial)
|
||||
{
|
||||
wornUniqueCodeMaterial.setCreateTime(DateUtils.getNowDate());
|
||||
return wornUniqueCodeMaterialMapper.insertWornUniqueCodeMaterial(wornUniqueCodeMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改唯一码物料信息
|
||||
*
|
||||
* @param wornUniqueCodeMaterial 唯一码物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWornUniqueCodeMaterial(WornUniqueCodeMaterial wornUniqueCodeMaterial)
|
||||
{
|
||||
wornUniqueCodeMaterial.setUpdateTime(DateUtils.getNowDate());
|
||||
return wornUniqueCodeMaterialMapper.updateWornUniqueCodeMaterial(wornUniqueCodeMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除唯一码物料信息
|
||||
*
|
||||
* @param ids 需要删除的唯一码物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornUniqueCodeMaterialByIds(Long[] ids)
|
||||
{
|
||||
return wornUniqueCodeMaterialMapper.deleteWornUniqueCodeMaterialByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除唯一码物料信息信息
|
||||
*
|
||||
* @param id 唯一码物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornUniqueCodeMaterialById(Long id)
|
||||
{
|
||||
return wornUniqueCodeMaterialMapper.deleteWornUniqueCodeMaterialById(id);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
package com.shzg.project.unique.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.shzg.common.exception.ServiceException;
|
||||
import com.shzg.common.utils.DateUtils;
|
||||
import com.shzg.common.utils.SecurityUtils;
|
||||
import com.shzg.framework.aspectj.lang.annotation.DataScope;
|
||||
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.WornUniqueCodeMaterialMapper;
|
||||
import com.shzg.project.unique.unit.QrCodeUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.shzg.project.unique.mapper.WornUniqueCodeMapper;
|
||||
import com.shzg.project.unique.domain.WornUniqueCode;
|
||||
import com.shzg.project.unique.service.IWornUniqueCodeService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 唯一码管理Service业务层处理
|
||||
@@ -20,6 +30,12 @@ public class WornUniqueCodeServiceImpl implements IWornUniqueCodeService
|
||||
@Autowired
|
||||
private WornUniqueCodeMapper wornUniqueCodeMapper;
|
||||
|
||||
@Autowired
|
||||
private WornUniqueCodeMaterialMapper materialMapper;
|
||||
|
||||
@Autowired
|
||||
private WornUniqueCodeEventMapper eventMapper;
|
||||
|
||||
/**
|
||||
* 查询唯一码管理
|
||||
*
|
||||
@@ -29,7 +45,39 @@ public class WornUniqueCodeServiceImpl implements IWornUniqueCodeService
|
||||
@Override
|
||||
public WornUniqueCode selectWornUniqueCodeById(Long id)
|
||||
{
|
||||
return wornUniqueCodeMapper.selectWornUniqueCodeById(id);
|
||||
/* 1️⃣ 主表 */
|
||||
WornUniqueCode code = wornUniqueCodeMapper.selectWornUniqueCodeById(id);
|
||||
|
||||
if (code == null)
|
||||
{
|
||||
throw new ServiceException("唯一码不存在");
|
||||
}
|
||||
|
||||
/* 2️⃣ 数据隔离校验(必须加) */
|
||||
Long deptId = SecurityUtils.getDeptId();
|
||||
if (!SecurityUtils.isAdmin() && !deptId.equals(code.getProjectId()))
|
||||
{
|
||||
throw new ServiceException("无权限查看该数据");
|
||||
}
|
||||
|
||||
/* 3️⃣ 查询物料(1条) */
|
||||
WornUniqueCodeMaterial material =
|
||||
materialMapper.selectByUniqueCodeId(id);
|
||||
|
||||
code.setMaterial(material);
|
||||
|
||||
/* 4️⃣ 查询事件(多条) */
|
||||
List<WornUniqueCodeEvent> eventList =
|
||||
eventMapper.selectByUniqueCodeId(id);
|
||||
|
||||
code.setEventList(eventList);
|
||||
|
||||
/* 5️⃣ 生成二维码 */
|
||||
String qrBase64 = QrCodeUtils.generateBase64(code.getCode());
|
||||
|
||||
code.setQrCode(qrBase64);
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,6 +86,7 @@ public class WornUniqueCodeServiceImpl implements IWornUniqueCodeService
|
||||
* @param wornUniqueCode 唯一码管理
|
||||
* @return 唯一码管理
|
||||
*/
|
||||
@DataScope(deptAlias = "d")
|
||||
@Override
|
||||
public List<WornUniqueCode> selectWornUniqueCodeList(WornUniqueCode wornUniqueCode)
|
||||
{
|
||||
@@ -51,12 +100,49 @@ public class WornUniqueCodeServiceImpl implements IWornUniqueCodeService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertWornUniqueCode(WornUniqueCode wornUniqueCode)
|
||||
{
|
||||
wornUniqueCode.setCreateTime(DateUtils.getNowDate());
|
||||
return wornUniqueCodeMapper.insertWornUniqueCode(wornUniqueCode);
|
||||
}
|
||||
WornUniqueCodeMaterial material = wornUniqueCode.getMaterial();
|
||||
|
||||
if (material == null)
|
||||
{
|
||||
throw new RuntimeException("物料信息不能为空");
|
||||
}
|
||||
|
||||
Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
|
||||
wornUniqueCode.setProjectId(deptId);
|
||||
|
||||
/* ================== 1️⃣ 主表 ================== */
|
||||
wornUniqueCode.setCreateTime(DateUtils.getNowDate());
|
||||
wornUniqueCode.setStatus("0");
|
||||
|
||||
wornUniqueCodeMapper.insertWornUniqueCode(wornUniqueCode);
|
||||
|
||||
Long id = wornUniqueCode.getId();
|
||||
|
||||
/* ================== 2️⃣ 生成code ================== */
|
||||
String code = String.valueOf(600000 + id);
|
||||
wornUniqueCode.setCode(code);
|
||||
wornUniqueCodeMapper.updateWornUniqueCode(wornUniqueCode);
|
||||
|
||||
/* ================== 3️⃣ 插入物料 ================== */
|
||||
material.setUniqueCodeId(id);
|
||||
material.setCreateTime(DateUtils.getNowDate());
|
||||
materialMapper.insertWornUniqueCodeMaterial(material);
|
||||
|
||||
/* ================== 4️⃣ 插入事件 ================== */
|
||||
WornUniqueCodeEvent event = new WornUniqueCodeEvent();
|
||||
event.setUniqueCodeId(id);
|
||||
event.setEventType("0");
|
||||
event.setEventStatus("0");
|
||||
event.setEventDesc("唯一码生成");
|
||||
event.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
eventMapper.insertWornUniqueCodeEvent(event);
|
||||
|
||||
return 1;
|
||||
}
|
||||
/**
|
||||
* 修改唯一码管理
|
||||
*
|
||||
@@ -82,15 +168,4 @@ public class WornUniqueCodeServiceImpl implements IWornUniqueCodeService
|
||||
return wornUniqueCodeMapper.deleteWornUniqueCodeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除唯一码管理信息
|
||||
*
|
||||
* @param id 唯一码管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWornUniqueCodeById(Long id)
|
||||
{
|
||||
return wornUniqueCodeMapper.deleteWornUniqueCodeById(id);
|
||||
}
|
||||
}
|
||||
|
||||
38
src/main/java/com/shzg/project/unique/unit/QrCodeUtils.java
Normal file
38
src/main/java/com/shzg/project/unique/unit/QrCodeUtils.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.shzg.project.unique.unit;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.Base64;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.MultiFormatWriter;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.client.j2se.MatrixToImageWriter;
|
||||
|
||||
public class QrCodeUtils
|
||||
{
|
||||
public static String generateBase64(String text)
|
||||
{
|
||||
try
|
||||
{
|
||||
int width = 200;
|
||||
int height = 200;
|
||||
|
||||
BitMatrix matrix = new MultiFormatWriter()
|
||||
.encode(text, BarcodeFormat.QR_CODE, width, height);
|
||||
|
||||
BufferedImage image = MatrixToImageWriter.toBufferedImage(matrix);
|
||||
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
ImageIO.write(image, "png", stream);
|
||||
|
||||
return "data:image/png;base64," +
|
||||
Base64.getEncoder().encodeToString(stream.toByteArray());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new RuntimeException("二维码生成失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
112
src/main/resources/mybatis/unique/WornUniqueCodeEventMapper.xml
Normal file
112
src/main/resources/mybatis/unique/WornUniqueCodeEventMapper.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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.unique.mapper.WornUniqueCodeEventMapper">
|
||||
|
||||
<resultMap type="WornUniqueCodeEvent" id="WornUniqueCodeEventResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="uniqueCodeId" column="unique_code_id" />
|
||||
<result property="eventType" column="event_type" />
|
||||
<result property="eventStatus" column="event_status" />
|
||||
<result property="eventDesc" column="event_desc" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="operatorName" column="operator_name" />
|
||||
<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="remark" column="remark" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornUniqueCodeEventVo">
|
||||
select id, unique_code_id, event_type, event_status, event_desc, operator_id, operator_name, create_by, create_time, update_by, update_time, remark, is_delete from worn_unique_code_event
|
||||
</sql>
|
||||
|
||||
<select id="selectWornUniqueCodeEventList" parameterType="WornUniqueCodeEvent" resultMap="WornUniqueCodeEventResult">
|
||||
<include refid="selectWornUniqueCodeEventVo"/>
|
||||
<where>
|
||||
<if test="uniqueCodeId != null "> and unique_code_id = #{uniqueCodeId}</if>
|
||||
<if test="eventType != null and eventType != ''"> and event_type = #{eventType}</if>
|
||||
<if test="eventStatus != null and eventStatus != ''"> and event_status = #{eventStatus}</if>
|
||||
<if test="eventDesc != null and eventDesc != ''"> and event_desc = #{eventDesc}</if>
|
||||
<if test="operatorId != null "> and operator_id = #{operatorId}</if>
|
||||
<if test="operatorName != null and operatorName != ''"> and operator_name like concat('%', #{operatorName}, '%')</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWornUniqueCodeEventById" parameterType="Long" resultMap="WornUniqueCodeEventResult">
|
||||
<include refid="selectWornUniqueCodeEventVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWornUniqueCodeEvent" parameterType="WornUniqueCodeEvent" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_unique_code_event
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">unique_code_id,</if>
|
||||
<if test="eventType != null and eventType != ''">event_type,</if>
|
||||
<if test="eventStatus != null">event_status,</if>
|
||||
<if test="eventDesc != null">event_desc,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="operatorName != null">operator_name,</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="remark != null">remark,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">#{uniqueCodeId},</if>
|
||||
<if test="eventType != null and eventType != ''">#{eventType},</if>
|
||||
<if test="eventStatus != null">#{eventStatus},</if>
|
||||
<if test="eventDesc != null">#{eventDesc},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="operatorName != null">#{operatorName},</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="remark != null">#{remark},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornUniqueCodeEvent" parameterType="WornUniqueCodeEvent">
|
||||
update worn_unique_code_event
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">unique_code_id = #{uniqueCodeId},</if>
|
||||
<if test="eventType != null and eventType != ''">event_type = #{eventType},</if>
|
||||
<if test="eventStatus != null">event_status = #{eventStatus},</if>
|
||||
<if test="eventDesc != null">event_desc = #{eventDesc},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="operatorName != null">operator_name = #{operatorName},</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="remark != null">remark = #{remark},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornUniqueCodeEventById" parameterType="Long">
|
||||
delete from worn_unique_code_event where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornUniqueCodeEventByIds" parameterType="String">
|
||||
delete from worn_unique_code_event where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectByUniqueCodeId" resultType="WornUniqueCodeMaterial">
|
||||
SELECT *
|
||||
FROM worn_unique_code_material
|
||||
WHERE unique_code_id = #{uniqueCodeId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -25,15 +25,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<select id="selectWornUniqueCodeList" parameterType="WornUniqueCode" resultMap="WornUniqueCodeResult">
|
||||
<include refid="selectWornUniqueCodeVo"/>
|
||||
SELECT t.*
|
||||
FROM worn_unique_code t
|
||||
LEFT JOIN sys_dept d ON t.project_id = d.dept_id
|
||||
<where>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="rfidCode != null and rfidCode != ''"> and rfid_code = #{rfidCode}</if>
|
||||
<if test="printCount != null "> and print_count = #{printCount}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
<if test="code != null and code != ''"> and t.code = #{code}</if>
|
||||
<if test="billNo != null and billNo != ''"> and t.bill_no = #{billNo}</if>
|
||||
<if test="projectId != null "> and t.project_id = #{projectId}</if>
|
||||
<if test="status != null and status != ''"> and t.status = #{status}</if>
|
||||
<if test="rfidCode != null and rfidCode != ''"> and t.rfid_code = #{rfidCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -93,9 +93,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornUniqueCodeById" parameterType="Long">
|
||||
delete from worn_unique_code where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornUniqueCodeByIds" parameterType="String">
|
||||
delete from worn_unique_code where id in
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<?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.unique.mapper.WornUniqueCodeMaterialMapper">
|
||||
|
||||
<resultMap type="WornUniqueCodeMaterial" id="WornUniqueCodeMaterialResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="uniqueCodeId" column="unique_code_id" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<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="remark" column="remark" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornUniqueCodeMaterialVo">
|
||||
select id, unique_code_id, material_id, unit_id, quantity, create_by, create_time, update_by, update_time, remark, is_delete from worn_unique_code_material
|
||||
</sql>
|
||||
|
||||
<select id="selectWornUniqueCodeMaterialList" parameterType="WornUniqueCodeMaterial" resultMap="WornUniqueCodeMaterialResult">
|
||||
<include refid="selectWornUniqueCodeMaterialVo"/>
|
||||
<where>
|
||||
<if test="uniqueCodeId != null "> and unique_code_id = #{uniqueCodeId}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="unitId != null "> and unit_id = #{unitId}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWornUniqueCodeMaterialById" parameterType="Long" resultMap="WornUniqueCodeMaterialResult">
|
||||
<include refid="selectWornUniqueCodeMaterialVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<insert id="insertWornUniqueCodeMaterial" parameterType="WornUniqueCodeMaterial" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_unique_code_material
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">unique_code_id,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="quantity != null">quantity,</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="remark != null">remark,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">#{uniqueCodeId},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="quantity != null">#{quantity},</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="remark != null">#{remark},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<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>
|
||||
<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="remark != null">remark = #{remark},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornUniqueCodeMaterialById" parameterType="Long">
|
||||
delete from worn_unique_code_material where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornUniqueCodeMaterialByIds" parameterType="String">
|
||||
delete from worn_unique_code_material where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectByUniqueCodeId" resultType="com.shzg.project.unique.domain.WornUniqueCodeMaterial">
|
||||
SELECT *
|
||||
FROM worn_unique_code_material
|
||||
WHERE unique_code_id = #{uniqueCodeId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user