From 73d26c1f8b1afbda62a35ccd4935e0487f36b1a0 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Tue, 17 Oct 2023 17:40:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?sap=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=EF=BC=8C=E6=9B=B4=E6=96=B0=E6=97=B6=E6=AE=B5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/sap/controller/SapController.java | 51 ++++++++++++++----- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java index 8d949d06..cb5caca5 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; +import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Map; @@ -81,8 +82,12 @@ public class SapController extends BaseController { logger.info("++++++++++++" + dateSource.get("poolName") + "++++product同步开始++++++++++"); DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key - Date maxTime = sapBomMapper.getProductMaxTime(); - if(maxTime != null){ + Date maxTime0 = sapBomMapper.getProductMaxTime(); + if(maxTime0 != null){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(maxTime0); + calendar.add(Calendar.DAY_OF_YEAR, 1); + Date maxTime = calendar.getTime(); qo.setLaeda(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923 } @@ -113,8 +118,12 @@ public class SapController extends BaseController { logger.info("++++++++++++" + dateSource.get("poolName") + "++++bom同步开始++++++++++"); DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key - Date maxTime = sapBomMapper.getProductMaxTime(); - if(maxTime != null){ + Date maxTime0 = sapBomMapper.getProductMaxTime(); + if(maxTime0 != null){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(maxTime0); + calendar.add(Calendar.DAY_OF_YEAR, 1); + Date maxTime = calendar.getTime(); qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923 } @@ -131,7 +140,6 @@ public class SapController extends BaseController { /** * 工艺路线同步 - * @param SapRouterQuery qo * @return */ @PostMapping("/sapRouterSync") @@ -147,8 +155,12 @@ public class SapController extends BaseController { logger.info("++++++++++++" + dateSource.get("poolName") + "++++工艺同步开始++++++++++"); DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key - Date maxTime = sapBomMapper.getRouteMaxTime(); - if(maxTime != null){ + Date maxTime0 = sapBomMapper.getRouteMaxTime(); + if(maxTime0 != null){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(maxTime0); + calendar.add(Calendar.DAY_OF_YEAR, 1); + Date maxTime = calendar.getTime(); qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923 } qo.setWerks(dateSource.get("poolName").replace("ds_",""));//工厂 @@ -227,8 +239,12 @@ public class SapController extends BaseController { logger.info("++++++++++++" + dateSource.get("poolName") + "++++工作中心开始++++++++++"); DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key qo.setWerks(dateSource.get("poolName").replace("ds_",""));//工厂 - Date maxTime = sapBomMapper.getMaxTime(); - if(maxTime != null){ + Date maxTime0 = sapBomMapper.getMaxTime(); + if(maxTime0 != null){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(maxTime0); + calendar.add(Calendar.DAY_OF_YEAR, 1); + Date maxTime = calendar.getTime(); qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923 } @@ -263,8 +279,12 @@ public class SapController extends BaseController { logger.info("++++++++++++" + dateSource.get("poolName") + "++++供应商主数据开始++++++++++"); DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key sapSupplierQuery.setBukrs(dateSource.get("poolName").replace("ds_",""));//工厂 - Date maxTime = sapBomMapper.getSupplierMaxTime(); - if(maxTime != null){ + Date maxTime0 = sapBomMapper.getSupplierMaxTime(); + if(maxTime0 != null){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(maxTime0); + calendar.add(Calendar.DAY_OF_YEAR, 1); + Date maxTime = calendar.getTime(); sapSupplierQuery.setErdat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923 } @@ -301,8 +321,13 @@ public class SapController extends BaseController { logger.info("++++++++++++" + dateSource.get("poolName") + "++++客户主数据开始++++++++++"); DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key sapCustom.setBukrs(dateSource.get("poolName").replace("ds_",""));//工厂 - Date maxTime = sapBomMapper.getCustomMaxTime(); - if(maxTime != null){ + Date maxTime0 = sapBomMapper.getCustomMaxTime(); + + if(maxTime0 != null){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(maxTime0); + calendar.add(Calendar.DAY_OF_YEAR, 1); + Date maxTime = calendar.getTime(); sapCustom.setErdat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923 } From 23659427c640ab008e1b5c4fdd887a3d1822e871 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Tue, 17 Oct 2023 17:54:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A4=87=E5=93=81=E5=A4=87=E4=BB=B6?= =?UTF-8?q?=E9=A2=86=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EquSpareApplyController.java | 97 ++++++++ .../com/op/device/domain/EquSpareApply.java | 220 ++++++++++++++++++ .../op/device/mapper/EquSpareApplyMapper.java | 61 +++++ .../device/service/IEquSpareApplyService.java | 60 +++++ .../impl/EquSpareApplyServiceImpl.java | 102 ++++++++ .../mapper/device/EquSpareApplyMapper.xml | 143 ++++++++++++ 6 files changed, 683 insertions(+) create mode 100644 op-modules/op-device/src/main/java/com/op/device/controller/EquSpareApplyController.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/mapper/EquSpareApplyMapper.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/service/IEquSpareApplyService.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java create mode 100644 op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquSpareApplyController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquSpareApplyController.java new file mode 100644 index 00000000..6db2647a --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquSpareApplyController.java @@ -0,0 +1,97 @@ +package com.op.device.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.device.domain.EquSpareApply; +import com.op.device.service.IEquSpareApplyService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 申领记录Controller + * + * @author Open Platform + * @date 2023-10-17 + */ +@RestController +@RequestMapping("/sparePartsApplicationRecord") +public class EquSpareApplyController extends BaseController { + @Autowired + private IEquSpareApplyService equSpareApplyService; + + /** + * 查询申领记录列表 + */ + @RequiresPermissions("device:sparePartsApplicationRecord:list") + @GetMapping("/list") + public TableDataInfo list(EquSpareApply equSpareApply) { + startPage(); + List list = equSpareApplyService.selectEquSpareApplyList(equSpareApply); + return getDataTable(list); + } + + /** + * 导出申领记录列表 + */ + @RequiresPermissions("device:sparePartsApplicationRecord:export") + @Log(title = "申领记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EquSpareApply equSpareApply) { + List list = equSpareApplyService.selectEquSpareApplyList(equSpareApply); + ExcelUtil util = new ExcelUtil(EquSpareApply.class); + util.exportExcel(response, list, "申领记录数据"); + } + + /** + * 获取申领记录详细信息 + */ + @RequiresPermissions("device:sparePartsApplicationRecord:query") + @GetMapping(value = "/{applyId}") + public AjaxResult getInfo(@PathVariable("applyId") String applyId) { + return success(equSpareApplyService.selectEquSpareApplyByApplyId(applyId)); + } + + /** + * 新增申领记录 + */ + @RequiresPermissions("device:sparePartsApplicationRecord:add") + @Log(title = "申领记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EquSpareApply equSpareApply) { + return toAjax(equSpareApplyService.insertEquSpareApply(equSpareApply)); + } + + /** + * 修改申领记录 + */ + @RequiresPermissions("device:sparePartsApplicationRecord:edit") + @Log(title = "申领记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EquSpareApply equSpareApply) { + return toAjax(equSpareApplyService.updateEquSpareApply(equSpareApply)); + } + + /** + * 删除申领记录 + */ + @RequiresPermissions("device:sparePartsApplicationRecord:remove") + @Log(title = "申领记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{applyIds}") + public AjaxResult remove(@PathVariable String[] applyIds) { + return toAjax(equSpareApplyService.deleteEquSpareApplyByApplyIds(applyIds)); + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java new file mode 100644 index 00000000..183bf6a8 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java @@ -0,0 +1,220 @@ +package com.op.device.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 申领记录对象 equ_spare_apply + * + * @author Open Platform + * @date 2023-10-17 + */ +public class EquSpareApply extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键 */ + private String applyId; + + /** 出库单号 */ + @Excel(name = "出库单号") + private String applyCode; + + /** 备品备件编码 */ + @Excel(name = "备品备件编码") + private String spareCode; + + /** 备品备件名称 */ + @Excel(name = "备品备件名称") + private String spareName; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String spareModel; + + /** 数量 */ + @Excel(name = "数量") + private Long spareQuantity; + + /** 使用组线 */ + @Excel(name = "使用组线") + private String spareGroupLine; + + /** 使用设备 */ + @Excel(name = "使用设备") + private String spareUseEquipment; + + /** 领用时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "领用时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date applyTime; + + /** 申领人 */ + @Excel(name = "申领人") + private String applyPeople; + + /** 批准人 */ + @Excel(name = "批准人") + private String applyApprovePeople; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String attr1; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String attr2; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private String attr3; + + /** 删除标志 */ + private String delFlag; + + /** 工厂号 */ + @Excel(name = "工厂号") + private String factoryCode; + + public void setApplyId(String applyId) { + this.applyId = applyId; + } + + public String getApplyId() { + return applyId; + } + public void setApplyCode(String applyCode) { + this.applyCode = applyCode; + } + + public String getApplyCode() { + return applyCode; + } + public void setSpareCode(String spareCode) { + this.spareCode = spareCode; + } + + public String getSpareCode() { + return spareCode; + } + public void setSpareName(String spareName) { + this.spareName = spareName; + } + + public String getSpareName() { + return spareName; + } + public void setSpareModel(String spareModel) { + this.spareModel = spareModel; + } + + public String getSpareModel() { + return spareModel; + } + public void setSpareQuantity(Long spareQuantity) { + this.spareQuantity = spareQuantity; + } + + public Long getSpareQuantity() { + return spareQuantity; + } + public void setSpareGroupLine(String spareGroupLine) { + this.spareGroupLine = spareGroupLine; + } + + public String getSpareGroupLine() { + return spareGroupLine; + } + public void setSpareUseEquipment(String spareUseEquipment) { + this.spareUseEquipment = spareUseEquipment; + } + + public String getSpareUseEquipment() { + return spareUseEquipment; + } + public void setApplyTime(Date applyTime) { + this.applyTime = applyTime; + } + + public Date getApplyTime() { + return applyTime; + } + public void setApplyPeople(String applyPeople) { + this.applyPeople = applyPeople; + } + + public String getApplyPeople() { + return applyPeople; + } + public void setApplyApprovePeople(String applyApprovePeople) { + this.applyApprovePeople = applyApprovePeople; + } + + public String getApplyApprovePeople() { + return applyApprovePeople; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr2() { + return attr2; + } + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr3() { + return attr3; + } + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("applyId", getApplyId()) + .append("applyCode", getApplyCode()) + .append("spareCode", getSpareCode()) + .append("spareName", getSpareName()) + .append("spareModel", getSpareModel()) + .append("spareQuantity", getSpareQuantity()) + .append("spareGroupLine", getSpareGroupLine()) + .append("spareUseEquipment", getSpareUseEquipment()) + .append("applyTime", getApplyTime()) + .append("applyPeople", getApplyPeople()) + .append("applyApprovePeople", getApplyApprovePeople()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .toString(); + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquSpareApplyMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquSpareApplyMapper.java new file mode 100644 index 00000000..e9b74390 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquSpareApplyMapper.java @@ -0,0 +1,61 @@ +package com.op.device.mapper; + +import java.util.List; + +import com.op.device.domain.EquSpareApply; + +/** + * 申领记录Mapper接口 + * + * @author Open Platform + * @date 2023-10-17 + */ +public interface EquSpareApplyMapper { + /** + * 查询申领记录 + * + * @param applyId 申领记录主键 + * @return 申领记录 + */ + public EquSpareApply selectEquSpareApplyByApplyId(String applyId); + + /** + * 查询申领记录列表 + * + * @param equSpareApply 申领记录 + * @return 申领记录集合 + */ + public List selectEquSpareApplyList(EquSpareApply equSpareApply); + + /** + * 新增申领记录 + * + * @param equSpareApply 申领记录 + * @return 结果 + */ + public int insertEquSpareApply(EquSpareApply equSpareApply); + + /** + * 修改申领记录 + * + * @param equSpareApply 申领记录 + * @return 结果 + */ + public int updateEquSpareApply(EquSpareApply equSpareApply); + + /** + * 删除申领记录 + * + * @param applyId 申领记录主键 + * @return 结果 + */ + public int deleteEquSpareApplyByApplyId(String applyId); + + /** + * 批量删除申领记录 + * + * @param applyIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEquSpareApplyByApplyIds(String[] applyIds); +} diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquSpareApplyService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquSpareApplyService.java new file mode 100644 index 00000000..27569b55 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquSpareApplyService.java @@ -0,0 +1,60 @@ +package com.op.device.service; + +import java.util.List; +import com.op.device.domain.EquSpareApply; + +/** + * 申领记录Service接口 + * + * @author Open Platform + * @date 2023-10-17 + */ +public interface IEquSpareApplyService { + /** + * 查询申领记录 + * + * @param applyId 申领记录主键 + * @return 申领记录 + */ + public EquSpareApply selectEquSpareApplyByApplyId(String applyId); + + /** + * 查询申领记录列表 + * + * @param equSpareApply 申领记录 + * @return 申领记录集合 + */ + public List selectEquSpareApplyList(EquSpareApply equSpareApply); + + /** + * 新增申领记录 + * + * @param equSpareApply 申领记录 + * @return 结果 + */ + public int insertEquSpareApply(EquSpareApply equSpareApply); + + /** + * 修改申领记录 + * + * @param equSpareApply 申领记录 + * @return 结果 + */ + public int updateEquSpareApply(EquSpareApply equSpareApply); + + /** + * 批量删除申领记录 + * + * @param applyIds 需要删除的申领记录主键集合 + * @return 结果 + */ + public int deleteEquSpareApplyByApplyIds(String[] applyIds); + + /** + * 删除申领记录信息 + * + * @param applyId 申领记录主键 + * @return 结果 + */ + public int deleteEquSpareApplyByApplyId(String applyId); +} diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java new file mode 100644 index 00000000..277254c8 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java @@ -0,0 +1,102 @@ +package com.op.device.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.device.mapper.EquSpareApplyMapper; +import com.op.device.domain.EquSpareApply; +import com.op.device.service.IEquSpareApplyService; + +/** + * 申领记录Service业务层处理 + * + * @author Open Platform + * @date 2023-10-17 + */ +@Service +public class EquSpareApplyServiceImpl implements IEquSpareApplyService { + @Autowired + private EquSpareApplyMapper equSpareApplyMapper; + + /** + * 查询申领记录 + * + * @param applyId 申领记录主键 + * @return 申领记录 + */ + @Override + @DS("#header.poolName") + public EquSpareApply selectEquSpareApplyByApplyId(String applyId) { + return equSpareApplyMapper.selectEquSpareApplyByApplyId(applyId); + } + + /** + * 查询申领记录列表 + * + * @param equSpareApply 申领记录 + * @return 申领记录 + */ + @Override + @DS("#header.poolName") + public List selectEquSpareApplyList(EquSpareApply equSpareApply) { + return equSpareApplyMapper.selectEquSpareApplyList(equSpareApply); + } + + /** + * 新增申领记录 + * + * @param equSpareApply 申领记录 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertEquSpareApply(EquSpareApply equSpareApply) { + equSpareApply.setApplyId(IdUtils.fastSimpleUUID()); + equSpareApply.setCreateTime(DateUtils.getNowDate()); + equSpareApply.setCreateBy(SecurityUtils.getUsername()); + return equSpareApplyMapper.insertEquSpareApply(equSpareApply); + } + + /** + * 修改申领记录 + * + * @param equSpareApply 申领记录 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateEquSpareApply(EquSpareApply equSpareApply) { + equSpareApply.setUpdateTime(DateUtils.getNowDate()); + equSpareApply.setUpdateBy(SecurityUtils.getUsername()); + return equSpareApplyMapper.updateEquSpareApply(equSpareApply); + } + + /** + * 批量删除申领记录 + * + * @param applyIds 需要删除的申领记录主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteEquSpareApplyByApplyIds(String[] applyIds) { + return equSpareApplyMapper.deleteEquSpareApplyByApplyIds(applyIds); + } + + /** + * 删除申领记录信息 + * + * @param applyId 申领记录主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteEquSpareApplyByApplyId(String applyId) { + return equSpareApplyMapper.deleteEquSpareApplyByApplyId(applyId); + } +} diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml new file mode 100644 index 00000000..3ba31375 --- /dev/null +++ b/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select apply_id, apply_code, spare_code, spare_name, spare_model, spare_quantity, spare_group_line, spare_use_equipment, apply_time, apply_people, apply_approve_people, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_spare_apply + + + + + + + + insert into equ_spare_apply + + apply_id, + apply_code, + spare_code, + spare_name, + spare_model, + spare_quantity, + spare_group_line, + spare_use_equipment, + apply_time, + apply_people, + apply_approve_people, + attr1, + attr2, + attr3, + del_flag, + create_by, + create_time, + update_by, + update_time, + factory_code, + + + #{applyId}, + #{applyCode}, + #{spareCode}, + #{spareName}, + #{spareModel}, + #{spareQuantity}, + #{spareGroupLine}, + #{spareUseEquipment}, + #{applyTime}, + #{applyPeople}, + #{applyApprovePeople}, + #{attr1}, + #{attr2}, + #{attr3}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + + + + + update equ_spare_apply + + apply_code = #{applyCode}, + spare_code = #{spareCode}, + spare_name = #{spareName}, + spare_model = #{spareModel}, + spare_quantity = #{spareQuantity}, + spare_group_line = #{spareGroupLine}, + spare_use_equipment = #{spareUseEquipment}, + apply_time = #{applyTime}, + apply_people = #{applyPeople}, + apply_approve_people = #{applyApprovePeople}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + factory_code = #{factoryCode}, + + where apply_id = #{applyId} + + + + delete from equ_spare_apply where apply_id = #{applyId} + + + + delete from equ_spare_apply where apply_id in + + #{applyId} + + + \ No newline at end of file From c78f1542edbd296f7aa68af390a60f73bb215dc1 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 18 Oct 2023 14:31:34 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A4=87=E5=93=81=E5=A4=87=E4=BB=B6?= =?UTF-8?q?=E9=A2=86=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/device/domain/EquSpareApply.java | 35 +++++++++++++++++++ .../impl/EquSpareApplyServiceImpl.java | 9 +++++ .../mapper/device/EquSpareApplyMapper.xml | 22 +++++++----- 3 files changed, 57 insertions(+), 9 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java index 183bf6a8..fc645678 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java @@ -1,6 +1,8 @@ package com.op.device.domain; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -79,6 +81,39 @@ public class EquSpareApply extends BaseEntity { @Excel(name = "工厂号") private String factoryCode; + // 创建日期范围list + private List applyTimeArray; + + // 创建日期开始 + private String applyTimeStart; + + // 创建日期结束 + private String applyTimeEnd; + + public List getApplyTimeArray() { + return applyTimeArray; + } + + public void setApplyTimeArray(List applyTimeArray) { + this.applyTimeArray = applyTimeArray; + } + + public String getApplyTimeStart() { + return applyTimeStart; + } + + public void setApplyTimeStart(String createTimeStart) { + this.applyTimeStart = createTimeStart; + } + + public String getApplyTimeEnd() { + return applyTimeEnd; + } + + public void setApplyTimeEnd(String applyTimeEnd) { + this.applyTimeEnd = applyTimeEnd; + } + public void setApplyId(String applyId) { this.applyId = applyId; } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java index 277254c8..11a3b01d 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java @@ -1,5 +1,6 @@ package com.op.device.service.impl; +import java.text.SimpleDateFormat; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; @@ -44,6 +45,14 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService { @Override @DS("#header.poolName") public List selectEquSpareApplyList(EquSpareApply equSpareApply) { + if (equSpareApply.getApplyTimeArray() != null) { + // 设置创建日期开始和结束值 + if (equSpareApply.getApplyTimeArray().size() == 2) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + equSpareApply.setApplyTimeStart(formatter.format(equSpareApply.getApplyTimeArray().get(0))); + equSpareApply.setApplyTimeEnd(formatter.format(equSpareApply.getApplyTimeArray().get(1))); + } + } return equSpareApplyMapper.selectEquSpareApplyList(equSpareApply); } diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml index 3ba31375..c2f28cb4 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml @@ -34,26 +34,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"