diff --git a/src/main/java/com/gaotao/modules/base/controller/LabelSettingController.java b/src/main/java/com/gaotao/modules/base/controller/LabelSettingController.java new file mode 100644 index 0000000..35d8a85 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/controller/LabelSettingController.java @@ -0,0 +1,77 @@ +package com.gaotao.modules.base.controller; + + +import com.alibaba.fastjson.JSONObject; +import com.gaotao.common.utils.R; +import com.gaotao.modules.base.entity.LabelSettingData; +import com.gaotao.modules.base.service.BaseService; +import com.gaotao.modules.print.entity.DumpPrint; +import com.gaotao.modules.print.service.PrintService; +import com.gaotao.modules.print.service.SysUserPrinterService; +import com.gaotao.modules.schedule.data.ScheduleData; +import com.gaotao.modules.schedule.data.SearchScheduleData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpSession; +import java.util.List; + + +@RestController +@RequestMapping("/label/setting") +public class LabelSettingController { + + @Autowired + private BaseService baseService; + + /** + * @description: 查询打印标签的定义参数 + * @author LR + * @date 2022/12/27 17:49 + * @version 1.0 + */ + @RequestMapping(value = "getLabelSettingList") + public R getLabelSettingList(@RequestBody LabelSettingData inData){ + List resultList = baseService.getLabelSettingList(inData); + return R.ok() + .put("code", 200) + .put("msg", "操作成功!") + .put("rows", resultList) + .put("total", resultList.size()); + } + + /** + * @description: 插入标签自定义的数据 + * @author LR + * @date 2022/12/28 15:29 + * @version 1.0 + */ + @RequestMapping(value = "insertLabelSetting") + public R insertLabelSetting(@RequestBody LabelSettingData inData){ + baseService.insertLabelSetting(inData); + return R.ok() + .put("code", 200) + .put("msg", "操作成功!"); + } + + /** + * @description: 修改标签自定义的数据 + * @author LR + * @date 2022/12/28 15:30 + * @version 1.0 + */ + @RequestMapping(value = "updateLabelSetting") + public R updateLabelSetting(@RequestBody LabelSettingData inData){ + baseService.updateLabelSetting(inData); + return R.ok() + .put("code", 200) + .put("msg", "操作成功!"); + } + +} \ No newline at end of file diff --git a/src/main/java/com/gaotao/modules/base/dao/BaseMapper.java b/src/main/java/com/gaotao/modules/base/dao/BaseMapper.java index 32e1633..efc7d42 100644 --- a/src/main/java/com/gaotao/modules/base/dao/BaseMapper.java +++ b/src/main/java/com/gaotao/modules/base/dao/BaseMapper.java @@ -1639,4 +1639,35 @@ public interface BaseMapper { */ PartFamilyData getPartFamilyInfo(@Param("site") String site,@Param("familyID") String familyID); + /** + * @description: 获取标签定义的列表信息 + * @author LR + * @date 2022/12/27 17:55 + * @version 1.0 + */ + List getLabelSettingList(LabelSettingData inData); + + /** + * @description: 获取标签信息按照标签编号查询 + * @author LR + * @date 2022/12/28 15:48 + * @version 1.0 + */ + LabelSettingData getLabelSettingByLabelNo(String labelNo); + + /** + * @description: 插入标签的信息 + * @author LR + * @date 2022/12/28 16:02 + * @version 1.0 + */ + void insertLabelSetting(LabelSettingData inData); + + /** + * @description: 修改标签自定义的信息 + * @author LR + * @date 2022/12/28 16:03 + * @version 1.0 + */ + void updateLabelSetting(LabelSettingData inData); } diff --git a/src/main/java/com/gaotao/modules/base/entity/LabelSettingData.java b/src/main/java/com/gaotao/modules/base/entity/LabelSettingData.java new file mode 100644 index 0000000..a654773 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/LabelSettingData.java @@ -0,0 +1,65 @@ +package com.gaotao.modules.base.entity; + +import org.apache.ibatis.type.Alias; + +@Alias("LabelSettingData") +public class LabelSettingData { + private String labelNo;// + private String labelType;// + private String labelName;// + private String labelClass;// + private String remark;// + private String searchFlag;//是否查询 + + public LabelSettingData() { + + } + + public String getLabelNo() { + return labelNo; + } + + public void setLabelNo(String labelNo) { + this.labelNo = labelNo; + } + + public String getLabelType() { + return labelType; + } + + public void setLabelType(String labelType) { + this.labelType = labelType; + } + + public String getLabelName() { + return labelName; + } + + public void setLabelName(String labelName) { + this.labelName = labelName; + } + + public String getLabelClass() { + return labelClass; + } + + public void setLabelClass(String labelClass) { + this.labelClass = labelClass; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSearchFlag() { + return searchFlag; + } + + public void setSearchFlag(String searchFlag) { + this.searchFlag = searchFlag; + } +} diff --git a/src/main/java/com/gaotao/modules/base/service/BaseService.java b/src/main/java/com/gaotao/modules/base/service/BaseService.java index 74b62fe..26465fd 100644 --- a/src/main/java/com/gaotao/modules/base/service/BaseService.java +++ b/src/main/java/com/gaotao/modules/base/service/BaseService.java @@ -891,4 +891,27 @@ public interface BaseService { */ PartFamilyData getPartFamilyInfo(String site, String familyID); + /** + * @description: 查询打印标签的定义参数 + * @author LR + * @date 2022/12/27 17:55 + * @version 1.0 + */ + List getLabelSettingList(LabelSettingData inData); + + /** + * @description: 插入标签自定义的数据 + * @author LR + * @date 2022/12/28 15:30 + * @version 1.0 + */ + void insertLabelSetting(LabelSettingData inData); + + /** + * @description: 修改标签自定义的数据 + * @author LR + * @date 2022/12/28 15:31 + * @version 1.0 + */ + void updateLabelSetting(LabelSettingData inData); } diff --git a/src/main/java/com/gaotao/modules/base/service/Impl/BaseServiceImpl.java b/src/main/java/com/gaotao/modules/base/service/Impl/BaseServiceImpl.java index c0a6e87..807c5c4 100644 --- a/src/main/java/com/gaotao/modules/base/service/Impl/BaseServiceImpl.java +++ b/src/main/java/com/gaotao/modules/base/service/Impl/BaseServiceImpl.java @@ -3,6 +3,7 @@ package com.gaotao.modules.base.service.Impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gaotao.common.exception.XJException; import com.gaotao.common.utils.DateUtil; import com.gaotao.common.utils.PageUtils; import com.gaotao.modules.base.dao.BaseMapper; @@ -1846,4 +1847,37 @@ public class BaseServiceImpl implements BaseService { public PartFamilyData getPartFamilyInfo(String site, String familyID) { return baseMapper.getPartFamilyInfo(site,familyID); } + + @Override + public List getLabelSettingList(LabelSettingData inData) { + String searchFlag = inData.getSearchFlag(); + if("N".equalsIgnoreCase(searchFlag)){ + return new ArrayList(); + }else{ + //判断是否查询 + return baseMapper.getLabelSettingList(inData); + } + } + + @Override + @Transactional + public void insertLabelSetting(LabelSettingData inData) { + //公共参数 + String labelNo = inData.getLabelNo(); + //1.查询是否重复 + LabelSettingData labelSetting = baseMapper.getLabelSettingByLabelNo(labelNo); + //判断空值 + if(null == labelSetting){ + //2.判断没有问题 插入数据 + baseMapper.insertLabelSetting(inData); + }else{ + throw new XJException("标签编号重复!"); + } + } + + @Override + public void updateLabelSetting(LabelSettingData inData) { + //修改标签的信息 + baseMapper.updateLabelSetting(inData); + } } diff --git a/src/main/resources/mapper/base/BaseMapper.xml b/src/main/resources/mapper/base/BaseMapper.xml index ba11205..066dba3 100644 --- a/src/main/resources/mapper/base/BaseMapper.xml +++ b/src/main/resources/mapper/base/BaseMapper.xml @@ -1752,4 +1752,44 @@ AND scheduledate = #{scheduledate} + + + + + + + + + INSERT INTO ReportFileList(ReportID, ReportFamily, Reportfile, ReportType, Remark) + VALUES(#{labelNo}, #{labelType}, #{labelName}, #{labelClass}, #{remark}) + + + + + UPDATE ReportFileList SET ReportFamily = #{labelType}, Reportfile = #{labelName}, ReportType = #{labelClass}, Remark = #{remark} + + AND ReportID = #{labelNo} + + \ No newline at end of file