parent
d2b47aa260
commit
ae6f643fd1
34 changed files with 1479 additions and 43 deletions
@ -0,0 +1,64 @@ |
|||||||
|
package org.springblade.lims.Excel; |
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import lombok.Data; |
||||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class InstrumentExcel implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
@ExcelProperty("仪器/设备编号") |
||||||
|
private String code; |
||||||
|
|
||||||
|
@ExcelProperty("仪器/设备名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
@ExcelProperty("仪器/设备类型(实验设备、存贮仪器、计算仪器)") |
||||||
|
private String type; |
||||||
|
|
||||||
|
@ExcelProperty("型号") |
||||||
|
private String model; |
||||||
|
|
||||||
|
@ExcelProperty("出厂日期") |
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||||
|
private Date productionDate; |
||||||
|
|
||||||
|
@ExcelProperty("启用日期") |
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||||
|
private Date enableDate; |
||||||
|
|
||||||
|
@ExcelProperty("存放地点") |
||||||
|
private String storagePlace; |
||||||
|
|
||||||
|
@ExcelProperty("保管人") |
||||||
|
private String saveByName; |
||||||
|
|
||||||
|
@ExcelProperty("生产厂家及品牌") |
||||||
|
private String manufacturerBrand; |
||||||
|
|
||||||
|
@ExcelProperty("购置时间") |
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||||
|
private Date purchaseTime; |
||||||
|
|
||||||
|
@ExcelProperty("是否需要检定(是、否)") |
||||||
|
private String isVerification; |
||||||
|
|
||||||
|
@ExcelProperty("报废年限") |
||||||
|
private Integer scrapYears; |
||||||
|
|
||||||
|
@ExcelProperty("状态(正常、维修中、报废申请中、已报废)") |
||||||
|
private String instrumentStatus; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,185 @@ |
|||||||
|
package org.springblade.lims.entry; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import org.springframework.data.annotation.Id; |
||||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
* @date 2023年11月27日15:34:17 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("t_purchase_apply") |
||||||
|
public class PurchaseApply extends BaseEntity implements Serializable { |
||||||
|
|
||||||
|
/** |
||||||
|
* 业务主键 |
||||||
|
*/ |
||||||
|
@Id |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 业务编号 |
||||||
|
*/ |
||||||
|
private String businessCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 流程 |
||||||
|
*/ |
||||||
|
private String procId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 业务名称 |
||||||
|
*/ |
||||||
|
private String name; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 申请状态 |
||||||
|
*/ |
||||||
|
private String applyStatus; |
||||||
|
|
||||||
|
/** |
||||||
|
* 申请部门 |
||||||
|
*/ |
||||||
|
private String applyOrgId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购人 |
||||||
|
*/ |
||||||
|
private String purchaseUserId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 供应商 |
||||||
|
*/ |
||||||
|
private String supplierId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购说明 |
||||||
|
*/ |
||||||
|
private String applyContent; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购日期 |
||||||
|
*/ |
||||||
|
private String applyDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 到货时间 |
||||||
|
*/ |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
private Date expectedArrivalDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 验收单 |
||||||
|
*/ |
||||||
|
private String checkId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 验收情况 |
||||||
|
*/ |
||||||
|
private String assetCheck; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String notes; |
||||||
|
|
||||||
|
/** |
||||||
|
* 附件 |
||||||
|
*/ |
||||||
|
private String attach; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 制单人 |
||||||
|
*/ |
||||||
|
private String originatorId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 租户 |
||||||
|
*/ |
||||||
|
private String tenantId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 变更类型 |
||||||
|
*/ |
||||||
|
private String chsType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 变更状态 |
||||||
|
*/ |
||||||
|
private String chsStatus; |
||||||
|
|
||||||
|
/** |
||||||
|
* 变更版本号 |
||||||
|
*/ |
||||||
|
private String chsVersion; |
||||||
|
|
||||||
|
/** |
||||||
|
* 变更ID |
||||||
|
*/ |
||||||
|
private String changeInstanceId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 流程概要 |
||||||
|
*/ |
||||||
|
private String summary; |
||||||
|
|
||||||
|
/** |
||||||
|
* 最后审批人账户ID |
||||||
|
*/ |
||||||
|
private String latestApproverId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 最后审批人姓名 |
||||||
|
*/ |
||||||
|
private String latestApproverName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 下一节点审批人 |
||||||
|
*/ |
||||||
|
private String nextApproverIds; |
||||||
|
|
||||||
|
/** |
||||||
|
* 下一个审批节点审批人姓名,用逗号隔开 |
||||||
|
*/ |
||||||
|
private String nextApproverNames; |
||||||
|
|
||||||
|
/** |
||||||
|
* 审批意见 |
||||||
|
*/ |
||||||
|
private String approvalOpinion; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购日期开始 |
||||||
|
*/ |
||||||
|
@TableField(exist = false) |
||||||
|
private String applyDateBegin; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购日期结束 |
||||||
|
*/ |
||||||
|
@TableField(exist = false) |
||||||
|
private String applyDateEnd; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购清单list |
||||||
|
*/ |
||||||
|
@TableField(exist = false) |
||||||
|
private List<PurchaseOrder> orderList; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,108 @@ |
|||||||
|
package org.springblade.lims.entry; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import org.springframework.data.annotation.Id; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
* @date 2023年11月27日15:34:17 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("t_purchase_check") |
||||||
|
public class PurchaseCheck extends BaseEntity implements Serializable { |
||||||
|
|
||||||
|
/** |
||||||
|
* 业务主键 |
||||||
|
*/ |
||||||
|
@Id |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 业务编号 |
||||||
|
*/ |
||||||
|
private String businessCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 名称 |
||||||
|
*/ |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购申请 |
||||||
|
*/ |
||||||
|
private String applyId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 供应商 |
||||||
|
*/ |
||||||
|
private String supplierId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 验收人 |
||||||
|
*/ |
||||||
|
private String checkUserName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 到货日期 |
||||||
|
*/ |
||||||
|
private String receiveDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 验收时间 |
||||||
|
*/ |
||||||
|
private String checkDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 验收信息 |
||||||
|
*/ |
||||||
|
private String checkInformation; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String notes; |
||||||
|
|
||||||
|
/** |
||||||
|
* 附件 |
||||||
|
*/ |
||||||
|
private String attach; |
||||||
|
|
||||||
|
/** |
||||||
|
* 附件名称 |
||||||
|
*/ |
||||||
|
private String attachName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 制单人 |
||||||
|
*/ |
||||||
|
private String originatorId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 到货日期开始 |
||||||
|
*/ |
||||||
|
@TableField(exist = false) |
||||||
|
private String receiveDateBegin; |
||||||
|
|
||||||
|
/** |
||||||
|
* 到货日期结束 |
||||||
|
*/ |
||||||
|
@TableField(exist = false) |
||||||
|
private String receiveDateEnd; |
||||||
|
|
||||||
|
/** |
||||||
|
* 验收时间开始 |
||||||
|
*/ |
||||||
|
@TableField(exist = false) |
||||||
|
private String checkDateBegin; |
||||||
|
|
||||||
|
/** |
||||||
|
* 验收时间结束 |
||||||
|
*/ |
||||||
|
@TableField(exist = false) |
||||||
|
private String checkDateEnd; |
||||||
|
} |
||||||
@ -0,0 +1,81 @@ |
|||||||
|
package org.springblade.lims.entry; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import org.springframework.data.annotation.Id; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
* @date 2023年11月27日15:34:17 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("t_purchase_order") |
||||||
|
public class PurchaseOrder extends BaseEntity implements Serializable { |
||||||
|
|
||||||
|
/** |
||||||
|
* 业务主键 |
||||||
|
*/ |
||||||
|
@Id |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 物品编码 |
||||||
|
*/ |
||||||
|
private String code; |
||||||
|
|
||||||
|
/** |
||||||
|
* 物品名称 |
||||||
|
*/ |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 物品档案 |
||||||
|
*/ |
||||||
|
private String goodsId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 物品类型 |
||||||
|
*/ |
||||||
|
private String goodsType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 存放类型 |
||||||
|
*/ |
||||||
|
private String storageType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购数量 |
||||||
|
*/ |
||||||
|
private Integer purchaseNumber; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购单价 |
||||||
|
*/ |
||||||
|
private Double unitPrice; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String notes; |
||||||
|
|
||||||
|
/** |
||||||
|
* 采购单 |
||||||
|
*/ |
||||||
|
private String applyId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 验收单 |
||||||
|
*/ |
||||||
|
private String checkId; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 制单人 |
||||||
|
*/ |
||||||
|
private String originatorId; |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,62 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.controller; |
||||||
|
|
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.lims.entry.PurchaseApply; |
||||||
|
import org.springblade.lims.service.IPurchaseApplyService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
* @date 2023年11月27日15:34:17 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping("/purchaseApply") |
||||||
|
@Api(value = "", tags = "") |
||||||
|
public class PurchaseApplyController extends BladeController { |
||||||
|
|
||||||
|
private final IPurchaseApplyService service; |
||||||
|
|
||||||
|
@GetMapping("/page") |
||||||
|
public R<Object> page(PurchaseApply entry, Query query) { |
||||||
|
return R.data(service.findPage(entry, query)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 保存申请单 |
||||||
|
*/ |
||||||
|
@PostMapping("/saveApply") |
||||||
|
@ApiOperation(value = "保存申请单", notes = "保存申请单") |
||||||
|
public R saveApply(@RequestBody PurchaseApply entry) { |
||||||
|
return R.data(service.saveApply(entry)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据id查询信息 |
||||||
|
*/ |
||||||
|
@GetMapping("/getById") |
||||||
|
@ApiOperation(value = "根据id查询信息", notes = "根据id查询信息") |
||||||
|
public R getById(String id) { |
||||||
|
return R.data(service.findById(id)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 删除 |
||||||
|
*/ |
||||||
|
@GetMapping("/deleteById") |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "传入id") |
||||||
|
public R deleteById(@ApiParam(value = "主键集合", required = true) @RequestParam String id) { |
||||||
|
return R.status(service.deleteLogic(Func.toLongList(id))); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,106 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.controller; |
||||||
|
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.SneakyThrows; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Charsets; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.core.tool.utils.IoUtil; |
||||||
|
import org.springblade.lims.entry.PurchaseCheck; |
||||||
|
import org.springblade.lims.service.IPurchaseCheckService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
import org.springframework.web.multipart.MultipartFile; |
||||||
|
|
||||||
|
import javax.servlet.ServletOutputStream; |
||||||
|
import javax.servlet.http.HttpServletResponse; |
||||||
|
import javax.validation.Valid; |
||||||
|
import javax.validation.constraints.NotNull; |
||||||
|
import java.io.InputStream; |
||||||
|
import java.net.URLEncoder; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
* @date 2023年11月27日15:34:17 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping("/purchaseCheck") |
||||||
|
@Api(value = "", tags = "") |
||||||
|
public class PurchaseCheckController extends BladeController { |
||||||
|
|
||||||
|
private final IPurchaseCheckService service; |
||||||
|
private final HttpServletResponse response; |
||||||
|
|
||||||
|
@GetMapping("/page") |
||||||
|
public R<Object> page(PurchaseCheck entry, Query query) { |
||||||
|
return R.data(service.findPage(entry, query)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 保存申请单 |
||||||
|
*/ |
||||||
|
@PostMapping("/saveCheck") |
||||||
|
@ApiOperation(value = "保存验收单", notes = "保存验收单") |
||||||
|
public R saveApply(@RequestBody PurchaseCheck entry) { |
||||||
|
return R.data(service.saveCheck(entry)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据id查询信息 |
||||||
|
*/ |
||||||
|
@GetMapping("/getById") |
||||||
|
@ApiOperation(value = "根据id查询信息", notes = "根据id查询信息") |
||||||
|
public R getById(String id) { |
||||||
|
return R.data(service.getById(id)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 删除 |
||||||
|
*/ |
||||||
|
@GetMapping("/deleteById") |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "传入id") |
||||||
|
public R deleteById(@ApiParam(value = "主键集合", required = true) @RequestParam String id) { |
||||||
|
return R.status(service.deleteLogic(Func.toLongList(id))); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 上传文件 |
||||||
|
*/ |
||||||
|
@PostMapping("/uploadFile") |
||||||
|
public R<Map<String,String>> uploadFile(@RequestParam MultipartFile file) { |
||||||
|
return R.data(service.uploadFile(file)); |
||||||
|
} |
||||||
|
|
||||||
|
@SneakyThrows |
||||||
|
@GetMapping("/download/{id}") |
||||||
|
@ApiOperationSupport(order = 0) |
||||||
|
@ApiOperation(value = "下载文件", notes = "下载文件") |
||||||
|
public void download(@ApiParam(value = "下载的文件id", required = true) @Valid @NotNull @PathVariable("id") Long id) { |
||||||
|
PurchaseCheck entry = service.getById(id); |
||||||
|
String fileName = entry.getAttachName(); |
||||||
|
// 查询
|
||||||
|
InputStream inputStream = service.getInputStreamById(id); |
||||||
|
response.setContentType("application/vnd.ms-excel"); |
||||||
|
response.setCharacterEncoding(Charsets.UTF_8.name()); |
||||||
|
if (fileName != null) { |
||||||
|
fileName = URLEncoder.encode(fileName, Charsets.UTF_8.name()); |
||||||
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName); |
||||||
|
} |
||||||
|
ServletOutputStream outputStream = response.getOutputStream(); |
||||||
|
IoUtil.copy(inputStream, outputStream); |
||||||
|
IoUtil.closeQuietly(inputStream); |
||||||
|
IoUtil.closeQuietly(outputStream); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,67 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.controller; |
||||||
|
|
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.lims.entry.PurchaseOrder; |
||||||
|
import org.springblade.lims.service.IPurchaseOrderService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
* @date 2023年11月27日15:34:17 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping("/purchaseOrder") |
||||||
|
@Api(value = "", tags = "") |
||||||
|
public class PurchaseOrderController extends BladeController { |
||||||
|
|
||||||
|
private final IPurchaseOrderService service; |
||||||
|
|
||||||
|
@GetMapping("/page") |
||||||
|
public R<Object> page(PurchaseOrder entry, Query query) { |
||||||
|
return R.data(service.findPage(entry, query)); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/findLIst") |
||||||
|
public R<Object> findLIst(PurchaseOrder entry, Query query) { |
||||||
|
return R.data(service.findList(entry)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 保存申请单 |
||||||
|
*/ |
||||||
|
@PostMapping("/saveOrder") |
||||||
|
@ApiOperation(value = "保存采购清单", notes = "保存采购清单") |
||||||
|
public R saveOrder(@RequestBody PurchaseOrder entry) { |
||||||
|
return R.data(service.saveOrder(entry)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据id查询信息 |
||||||
|
*/ |
||||||
|
@GetMapping("/ById") |
||||||
|
@ApiOperation(value = "根据id查询信息", notes = "根据id查询信息") |
||||||
|
public R getById(String id) { |
||||||
|
return R.data(service.getById(id)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 删除 |
||||||
|
*/ |
||||||
|
@GetMapping("/deleteById") |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "传入id") |
||||||
|
public R deleteById(@ApiParam(value = "主键集合", required = true) @RequestParam String id) { |
||||||
|
return R.status(service.deleteLogic(Func.toLongList(id))); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import org.springblade.lims.entry.PurchaseApply; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* |
||||||
|
* @author sjx |
||||||
|
* @since 2023年11月27日15:47:39 |
||||||
|
*/ |
||||||
|
public interface PurchaseApplyMapper extends BaseMapper<PurchaseApply> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import org.springblade.lims.entry.PurchaseCheck; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* |
||||||
|
* @author sjx |
||||||
|
* @since 2023年11月27日15:47:39 |
||||||
|
*/ |
||||||
|
public interface PurchaseCheckMapper extends BaseMapper<PurchaseCheck> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import org.springblade.lims.entry.PurchaseOrder; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* |
||||||
|
* @author sjx |
||||||
|
* @since 2023年11月27日15:47:39 |
||||||
|
*/ |
||||||
|
public interface PurchaseOrderMapper extends BaseMapper<PurchaseOrder> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.service; |
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.lims.entry.PurchaseApply; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
* @date 2023年11月27日15:34:17 |
||||||
|
*/ |
||||||
|
public interface IPurchaseApplyService extends BaseService<PurchaseApply> { |
||||||
|
IPage<PurchaseApply> findPage(PurchaseApply entry, Query query); |
||||||
|
|
||||||
|
boolean saveApply(PurchaseApply entry); |
||||||
|
|
||||||
|
PurchaseApply findById(String id); |
||||||
|
} |
||||||
@ -0,0 +1,27 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.service; |
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.lims.entry.PurchaseCheck; |
||||||
|
import org.springframework.web.multipart.MultipartFile; |
||||||
|
|
||||||
|
import java.io.InputStream; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
* @date 2023年11月27日15:34:17 |
||||||
|
*/ |
||||||
|
public interface IPurchaseCheckService extends BaseService<PurchaseCheck> { |
||||||
|
IPage<PurchaseCheck> findPage(PurchaseCheck entry, Query query); |
||||||
|
|
||||||
|
boolean saveCheck(PurchaseCheck entry); |
||||||
|
|
||||||
|
Map<String,String> uploadFile(MultipartFile file); |
||||||
|
|
||||||
|
InputStream getInputStreamById(Long id); |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,22 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.service; |
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.lims.entry.PurchaseOrder; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author sjx |
||||||
|
* @date 2023年11月27日15:34:17 |
||||||
|
*/ |
||||||
|
public interface IPurchaseOrderService extends BaseService<PurchaseOrder> { |
||||||
|
IPage<PurchaseOrder> findPage(PurchaseOrder entry, Query query); |
||||||
|
List<PurchaseOrder> findList(PurchaseOrder entry); |
||||||
|
|
||||||
|
boolean saveOrder(PurchaseOrder entry); |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,121 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.service.impl; |
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.nacos.common.utils.StringUtils; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.apache.commons.lang3.time.DateFormatUtils; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.secure.utils.AuthUtil; |
||||||
|
import org.springblade.core.tool.utils.CollectionUtil; |
||||||
|
import org.springblade.core.tool.utils.StringUtil; |
||||||
|
import org.springblade.lims.entry.PurchaseApply; |
||||||
|
import org.springblade.lims.entry.PurchaseOrder; |
||||||
|
import org.springblade.lims.mapper.PurchaseApplyMapper; |
||||||
|
import org.springblade.lims.service.IPurchaseApplyService; |
||||||
|
import org.springblade.lims.service.IPurchaseOrderService; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @author swj |
||||||
|
* @since 2022年6月2日15:53:01 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class PurchaseApplyServiceImpl extends BaseServiceImpl<PurchaseApplyMapper, PurchaseApply> implements IPurchaseApplyService { |
||||||
|
|
||||||
|
private final IPurchaseOrderService purchaseOrderService; |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<PurchaseApply> findPage(PurchaseApply entry, Query query) { |
||||||
|
LambdaQueryWrapper<PurchaseApply> wrapper = new LambdaQueryWrapper<>(); |
||||||
|
if(entry.getApplyStatus() != null){ |
||||||
|
wrapper.eq(PurchaseApply::getApplyStatus,entry.getApplyStatus()); |
||||||
|
} |
||||||
|
if(StringUtils.isNotBlank(entry.getSupplierId())){ |
||||||
|
wrapper.eq(PurchaseApply::getSupplierId,entry.getSupplierId()); |
||||||
|
} |
||||||
|
if(StringUtils.isNotBlank(entry.getBusinessCode())){ |
||||||
|
wrapper.eq(PurchaseApply::getBusinessCode,entry.getBusinessCode()); |
||||||
|
} |
||||||
|
if(StringUtils.isNotBlank(entry.getName())){ |
||||||
|
wrapper.eq(PurchaseApply::getName,entry.getName()); |
||||||
|
} |
||||||
|
if(StringUtils.isNotBlank(entry.getAssetCheck())){ |
||||||
|
wrapper.eq(PurchaseApply::getAssetCheck,entry.getAssetCheck()); |
||||||
|
} |
||||||
|
if(StringUtils.isNotBlank(entry.getApplyDateBegin())){ |
||||||
|
wrapper.ge(PurchaseApply::getApplyDate,entry.getApplyDateBegin()); |
||||||
|
} |
||||||
|
if(StringUtils.isNotBlank(entry.getApplyDateEnd())){ |
||||||
|
wrapper.le(PurchaseApply::getApplyDate,entry.getApplyDateEnd()); |
||||||
|
} |
||||||
|
wrapper.eq(BaseEntity::getIsDeleted,0); |
||||||
|
wrapper.orderByDesc(PurchaseApply::getCreateTime); |
||||||
|
IPage<PurchaseApply> page = this.page(Condition.getPage(query), wrapper); |
||||||
|
return page; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public boolean saveApply(PurchaseApply entry) { |
||||||
|
Date date = new Date(); |
||||||
|
if(entry.getId() == null){ |
||||||
|
entry.setCreateUser(AuthUtil.getUserId()); |
||||||
|
entry.setCreateTime(date); |
||||||
|
entry.setBusinessCode("CGSQ"+ DateFormatUtils.format(date,"yyyyMMddhhmmss")+ StringUtil.randomUUID().substring(0,5)); |
||||||
|
entry.setOriginatorId(AuthUtil.getUserId().toString()); |
||||||
|
entry.setAssetCheck("0"); |
||||||
|
baseMapper.insert(entry); |
||||||
|
}else{ |
||||||
|
entry.setUpdateUser(AuthUtil.getUserId()); |
||||||
|
entry.setUpdateTime(date); |
||||||
|
baseMapper.updateById(entry); |
||||||
|
} |
||||||
|
//保存id到采购清单
|
||||||
|
if("0".equals(entry.getApplyStatus()) || "1".equals(entry.getApplyStatus())){ |
||||||
|
if(CollectionUtil.isNotEmpty(entry.getOrderList())){ |
||||||
|
//采购清单全删全增
|
||||||
|
PurchaseOrder oldOrder = new PurchaseOrder(); |
||||||
|
oldOrder.setApplyId(entry.getId().toString()); |
||||||
|
List<PurchaseOrder> oldOrderList = purchaseOrderService.findList(oldOrder); |
||||||
|
if(CollectionUtil.isNotEmpty(oldOrderList)){ |
||||||
|
for(PurchaseOrder order : oldOrderList){ |
||||||
|
purchaseOrderService.removeById(order.getId()); |
||||||
|
} |
||||||
|
} |
||||||
|
for(PurchaseOrder order : entry.getOrderList()){ |
||||||
|
order.setId(null); |
||||||
|
order.setApplyId(entry.getId().toString()); |
||||||
|
order.setUpdateUser(AuthUtil.getUserId()); |
||||||
|
order.setUpdateTime(date); |
||||||
|
purchaseOrderService.save(order); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public PurchaseApply findById(String id) { |
||||||
|
PurchaseApply entry = this.getById(id); |
||||||
|
//根据id查询对应采购清单
|
||||||
|
LambdaQueryWrapper<PurchaseOrder> orderQueryWrapper = new LambdaQueryWrapper<>(); |
||||||
|
orderQueryWrapper.eq(PurchaseOrder::getApplyId,entry.getId()); |
||||||
|
orderQueryWrapper.eq(BaseEntity::getIsDeleted,0); |
||||||
|
List<PurchaseOrder> orderList = purchaseOrderService.list(orderQueryWrapper); |
||||||
|
entry.setOrderList(orderList); |
||||||
|
return entry; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,153 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.service.impl; |
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.nacos.common.utils.StringUtils; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.SneakyThrows; |
||||||
|
import org.apache.commons.lang3.time.DateFormatUtils; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.secure.utils.AuthUtil; |
||||||
|
import org.springblade.core.tool.utils.StringUtil; |
||||||
|
import org.springblade.lims.entry.PurchaseApply; |
||||||
|
import org.springblade.lims.entry.PurchaseCheck; |
||||||
|
import org.springblade.lims.mapper.PurchaseCheckMapper; |
||||||
|
import org.springblade.lims.service.IPurchaseApplyService; |
||||||
|
import org.springblade.lims.service.IPurchaseCheckService; |
||||||
|
import org.springblade.system.feign.ISysClient; |
||||||
|
import org.springframework.core.io.ClassPathResource; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
import org.springframework.web.multipart.MultipartFile; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
import java.io.FileInputStream; |
||||||
|
import java.io.FileOutputStream; |
||||||
|
import java.io.InputStream; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Map; |
||||||
|
import java.util.UUID; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @author swj |
||||||
|
* @since 2022年6月2日15:53:01 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class PurchaseCheckServiceImpl extends BaseServiceImpl<PurchaseCheckMapper, PurchaseCheck> implements IPurchaseCheckService { |
||||||
|
|
||||||
|
private final ISysClient sysClient; |
||||||
|
|
||||||
|
private final IPurchaseApplyService purchaseApplyService; |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<PurchaseCheck> findPage(PurchaseCheck entry, Query query) { |
||||||
|
LambdaQueryWrapper<PurchaseCheck> wrapper = new LambdaQueryWrapper<>(); |
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(entry.getBusinessCode())){ |
||||||
|
wrapper.eq(PurchaseCheck::getBusinessCode,entry.getBusinessCode()); |
||||||
|
} |
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(entry.getName())){ |
||||||
|
wrapper.like(PurchaseCheck::getName,entry.getName()); |
||||||
|
} |
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(entry.getCheckUserName())){ |
||||||
|
wrapper.eq(PurchaseCheck::getCheckUserName,entry.getCheckUserName()); |
||||||
|
} |
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(entry.getCheckUserName())){ |
||||||
|
wrapper.eq(PurchaseCheck::getCheckUserName,entry.getCheckUserName()); |
||||||
|
} |
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(entry.getReceiveDateBegin())){ |
||||||
|
wrapper.ge(PurchaseCheck::getReceiveDate,entry.getReceiveDateBegin()); |
||||||
|
} |
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(entry.getReceiveDateEnd())){ |
||||||
|
wrapper.le(PurchaseCheck::getReceiveDate,entry.getReceiveDateEnd()); |
||||||
|
} |
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(entry.getCheckDateBegin())){ |
||||||
|
wrapper.ge(PurchaseCheck::getCheckDate,entry.getCheckDateBegin()); |
||||||
|
} |
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(entry.getCheckDateEnd())){ |
||||||
|
wrapper.le(PurchaseCheck::getCheckDate,entry.getCheckDateEnd()); |
||||||
|
} |
||||||
|
wrapper.eq(BaseEntity::getIsDeleted,0); |
||||||
|
wrapper.orderByDesc(PurchaseCheck::getCreateTime); |
||||||
|
IPage<PurchaseCheck> page = this.page(Condition.getPage(query), wrapper); |
||||||
|
return page; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public boolean saveCheck(PurchaseCheck entry) { |
||||||
|
Date date = new Date(); |
||||||
|
entry.setBusinessCode("CGYS"+ DateFormatUtils.format(date,"yyyyMMddhhmmss")+ StringUtil.randomUUID().substring(0,5)); |
||||||
|
entry.setCreateUser(AuthUtil.getUserId()); |
||||||
|
entry.setCreateTime(date); |
||||||
|
entry.setOriginatorId(AuthUtil.getUserId().toString()); |
||||||
|
baseMapper.insert(entry); |
||||||
|
//根据采购申请id更新采购申请单
|
||||||
|
LambdaQueryWrapper<PurchaseApply> wrapper = new LambdaQueryWrapper<>(); |
||||||
|
wrapper.eq(PurchaseApply::getId,entry.getApplyId()); |
||||||
|
wrapper.eq(BaseEntity::getIsDeleted,0); |
||||||
|
PurchaseApply apply = purchaseApplyService.getOne(wrapper); |
||||||
|
apply.setApplyStatus("4"); |
||||||
|
apply.setCheckId(entry.getId().toString()); |
||||||
|
apply.setAssetCheck("1"); |
||||||
|
purchaseApplyService.updateById(apply); |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Map<String,String> uploadFile(MultipartFile file) { |
||||||
|
Map<String,String> map = new HashMap<>(); |
||||||
|
String fileName = ""; |
||||||
|
String path = ""; |
||||||
|
String originalFilename = ""; |
||||||
|
if (file != null) { |
||||||
|
originalFilename = file.getOriginalFilename(); |
||||||
|
String fileSuffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); |
||||||
|
fileName = UUID.randomUUID().toString() + fileSuffix; |
||||||
|
path = sysClient.getParamValue("jiahe").getData() + fileName; |
||||||
|
|
||||||
|
FileOutputStream fout; |
||||||
|
try { |
||||||
|
fout = new FileOutputStream(path); |
||||||
|
fout.write(file.getBytes()); |
||||||
|
fout.close(); |
||||||
|
} catch (Exception e) { |
||||||
|
e.printStackTrace(); |
||||||
|
} |
||||||
|
} |
||||||
|
map.put("filename",originalFilename); |
||||||
|
map.put("path",path); |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@SneakyThrows |
||||||
|
public InputStream getInputStreamById(Long id) { |
||||||
|
PurchaseCheck entry = this.getById(id); |
||||||
|
InputStream inputStream; |
||||||
|
File file = new File(entry.getAttach()); |
||||||
|
if (file.exists()) { |
||||||
|
inputStream = new FileInputStream(file); |
||||||
|
} else { |
||||||
|
inputStream = new ClassPathResource("FileNotFound.xlsx").getInputStream(); |
||||||
|
} |
||||||
|
return inputStream; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,78 @@ |
|||||||
|
|
||||||
|
package org.springblade.lims.service.impl; |
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.nacos.common.utils.StringUtils; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.secure.utils.AuthUtil; |
||||||
|
import org.springblade.lims.entry.PurchaseOrder; |
||||||
|
import org.springblade.lims.mapper.PurchaseOrderMapper; |
||||||
|
import org.springblade.lims.service.IPurchaseOrderService; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @author swj |
||||||
|
* @since 2022年6月2日15:53:01 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class PurchaseOrderServiceImpl extends BaseServiceImpl<PurchaseOrderMapper, PurchaseOrder> implements IPurchaseOrderService { |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<PurchaseOrder> findPage(PurchaseOrder entry, Query query) { |
||||||
|
LambdaQueryWrapper<PurchaseOrder> wrapper = new LambdaQueryWrapper<>(); |
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(entry.getName())){ |
||||||
|
wrapper.like(PurchaseOrder::getName,entry.getName()); |
||||||
|
} |
||||||
|
wrapper.eq(BaseEntity::getIsDeleted,0); |
||||||
|
wrapper.orderByDesc(PurchaseOrder::getCreateTime); |
||||||
|
IPage<PurchaseOrder> page = this.page(Condition.getPage(query), wrapper); |
||||||
|
return page; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<PurchaseOrder> findList(PurchaseOrder entry) { |
||||||
|
LambdaQueryWrapper<PurchaseOrder> wrapper = new LambdaQueryWrapper<>(); |
||||||
|
if(StringUtils.isNotBlank(entry.getName())){ |
||||||
|
wrapper.like(PurchaseOrder::getName,entry.getName()); |
||||||
|
} |
||||||
|
if(StringUtils.isNotBlank(entry.getApplyId())){ |
||||||
|
wrapper.like(PurchaseOrder::getApplyId,entry.getApplyId()); |
||||||
|
} |
||||||
|
wrapper.eq(BaseEntity::getIsDeleted,0); |
||||||
|
wrapper.orderByDesc(PurchaseOrder::getCreateTime); |
||||||
|
List<PurchaseOrder> list = this.list(wrapper); |
||||||
|
return list; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public boolean saveOrder(PurchaseOrder entry) { |
||||||
|
Date date = new Date(); |
||||||
|
if(entry.getId() == null){ |
||||||
|
entry.setCreateUser(AuthUtil.getUserId()); |
||||||
|
entry.setCreateTime(date); |
||||||
|
entry.setOriginatorId(AuthUtil.getUserId().toString()); |
||||||
|
baseMapper.insert(entry); |
||||||
|
}else{ |
||||||
|
entry.setUpdateUser(AuthUtil.getUserId()); |
||||||
|
entry.setUpdateTime(date); |
||||||
|
baseMapper.updateById(entry); |
||||||
|
} |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue