Merge branch 'master' of http://111.30.93.211:10101/r/supipe
已修改23个文件
已添加17个文件
已删除4个文件
| | |
| | | server: |
| | | port: 8883 |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | | - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | |
| | | import io.netty.channel.socket.nio.NioServerSocketChannel; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | |
| | | */ |
| | | private EventLoopGroup work = new NioEventLoopGroup(); |
| | | |
| | | @Value("${netty.port}") |
| | | private String port; |
| | | |
| | | /** |
| | | * 启动Netty Server |
| | | * |
| | |
| | | // 指定Channel |
| | | .channel(NioServerSocketChannel.class) |
| | | //使用指定的端口设置套接字地址 |
| | | .localAddress(new InetSocketAddress(10001)) |
| | | .localAddress(new InetSocketAddress(Integer.parseInt(port))) |
| | | |
| | | //服务端可连接队列数,对应TCP/IP协议listen函数中backlog参数 |
| | | .option(ChannelOption.SO_BACKLOG, 1024) |
| | |
| | | server: |
| | | port: 8882 |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | | - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | |
| | | |
| | | <select id="groupUserWorking" resultType="com.thhy.staff.modules.biz.platuser.entity.GroupWorking"> |
| | | select sg.group_id as groupId,sg.group_name as groupName, |
| | | (select count(user_id) from sys_group_user where group_id = sg.group_id) as groupUserCount |
| | | (select count(user_id) from sys_group_user where and is_use = 1 and group_id = sg.group_id) as groupUserCount |
| | | from sys_group sg |
| | | left join sys_com_depart sd on sg.depart_id = sd.depart_id |
| | | where sg.is_use = 1 and sd.company_id = #{companyId} |
| | |
| | | server: |
| | | port: 8881 |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | | - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | |
| | | String proId = projectMapper.proNameByOne(proName); |
| | | |
| | | if(!StringUtil.isEmpty(proId)){ |
| | | BasicResult.faild("11111","error","项目名称被占用"); |
| | | BasicResult.faild("11111","项目名称被占用",null); |
| | | } |
| | | String proNumber =""; |
| | | SysProject project = projectMapper.newByProject(); |
| | |
| | | public BasicResult segmentUpdate(Map<String, Object> values) { |
| | | String segmentId1 = values.get("segmentId").toString(); |
| | | |
| | | String segmentName = values.get("segmentName").toString(); |
| | | String unitProjectName = values.get("unitProjectName").toString(); |
| | | |
| | | String segmentId = segmentMapper.segmentNameByOne(segmentName); |
| | | if(segmentId!=null && !segmentId.equals(segmentId1)){ |
| | | String segmentId = segmentMapper.segmentNameByProjectName(unitProjectName); |
| | | if(!segmentId1.equals(segmentId)){ |
| | | return BasicResult.faild("11111","error","标段名称被占用"); |
| | | } |
| | | segmentMapper.segmentUpdate(values); |
| | |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | | - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | | - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | |
| | | server: |
| | | port: 8880 |
| | | spring: |
| | | cloud: |
| | | nacos: |
| | |
| | | discovery: |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: pipe |
| | | group: supipe |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | |
| | | import com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentGoodsEntity; |
| | | import com.thhy.materials.modules.biz.embedment.service.SysEmbedmentGoodsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @Author QiuYuHao |
| | |
| | | public BasicResult findAll(@RequestBody EmbedmentGoodsDto embedmentGoodsDto){ |
| | | return sysEmbedmentGoodsService.findAll(embedmentGoodsDto); |
| | | } |
| | | |
| | | //查询库存单条 |
| | | @GetMapping("/findEntity") |
| | | public BasicResult findEntity(@RequestParam String id){ |
| | | return sysEmbedmentGoodsService.findEntity(id); |
| | | } |
| | | //查询规格 |
| | | @GetMapping("/findAllDetails") |
| | | public BasicResult findAllDetails(String id){ |
| | | return sysEmbedmentGoodsService.findAllDetails(id); |
| | | } |
| | | |
| | | //查询dict类型 |
| | | @GetMapping("/getType") |
| | | public BasicResult getType(){ |
| | | return sysEmbedmentGoodsService.getType(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.thhy.materials.modules.biz.embedment.controller; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.thhy.general.common.BasicResult; |
| | | import com.thhy.materials.modules.biz.concret.entity.SysSteelRecord; |
| | | import com.thhy.materials.modules.biz.embedment.dto.EmbedmentRecordDto; |
| | | import com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity; |
| | | import com.thhy.materials.modules.biz.embedment.service.SysEmbedmentRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @Author QiuYuHao |
| | |
| | | @RequestMapping(value = "embedmentInsetRecord") |
| | | public class SysInsetRecordsController { |
| | | |
| | | @Autowired |
| | | private SysEmbedmentRecordService sysEmbedmentRecordService; |
| | | |
| | | /** |
| | | * 新增记录 |
| | | * @param sysEmbedmentRecordEntity |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "insert") |
| | | public BasicResult insert (@RequestBody SysEmbedmentRecordEntity sysEmbedmentRecordEntity){ |
| | | synchronized (this){ |
| | | return sysEmbedmentRecordService.insert(sysEmbedmentRecordEntity); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 记录删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "embedmentRecordDel") |
| | | public BasicResult embedmentRecordDel (@RequestParam String id){ |
| | | return sysEmbedmentRecordService.embedmentRecordDel(id); |
| | | } |
| | | |
| | | /** |
| | | * 记录修改 |
| | | * @param sysEmbedmentRecordEntity |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "update") |
| | | BasicResult update(@RequestBody SysEmbedmentRecordEntity sysEmbedmentRecordEntity){ |
| | | synchronized (this){ |
| | | return sysEmbedmentRecordService.update(sysEmbedmentRecordEntity); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 入库记录查询 |
| | | * @param embedmentRecordDto |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "embedmentRecordList") |
| | | BasicResult embedmentRecordList(@RequestBody EmbedmentRecordDto embedmentRecordDto){ |
| | | return sysEmbedmentRecordService.embedmentRecordList(embedmentRecordDto); |
| | | } |
| | | |
| | | /** |
| | | * 出库记录查询 |
| | | * @param embedmentRecordDto |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "embedmentRecordOutList") |
| | | BasicResult embedmentRecordOutList(@RequestBody EmbedmentRecordDto embedmentRecordDto){ |
| | | return sysEmbedmentRecordService.embedmentRecordOutList(embedmentRecordDto); |
| | | } |
| | | |
| | | /** |
| | | * 出入库详情查询 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "embedmentRecordInfo") |
| | | public BasicResult embedmentRecordInfo (@RequestParam String id){ |
| | | return sysEmbedmentRecordService.embedmentRecordInfo(id); |
| | | } |
| | | |
| | | /** |
| | | * 导出 |
| | | * @param embedmentRecordDto |
| | | * @param response |
| | | */ |
| | | @PostMapping(value = "export") |
| | | void export(@RequestBody EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response){ |
| | | this.sysEmbedmentRecordService.export(embedmentRecordDto,response); |
| | | } |
| | | |
| | | /** |
| | | * 导出模板 |
| | | * @param embedmentRecordDto |
| | | * @param response |
| | | */ |
| | | @PostMapping(value = "recordExportTemplate") |
| | | void recordExportTemplate(@RequestBody EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response){ |
| | | this.sysEmbedmentRecordService.recordExportTemplate(embedmentRecordDto,response); |
| | | } |
| | | |
| | | /** |
| | | * 导入 |
| | | * @param file |
| | | * @param request |
| | | */ |
| | | @PostMapping(value = "variateExcel") |
| | | BasicResult variateExcel(@RequestParam MultipartFile file, HttpServletRequest request){ |
| | | synchronized (this){ |
| | | return this.sysEmbedmentRecordService.variateExcel(file,request); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/alarmSet") |
| | | public BasicResult alarmSet(EmbedmentGoodsDto embedmentGoodsDto){ |
| | | public BasicResult alarmSet(@RequestBody EmbedmentGoodsDto embedmentGoodsDto){ |
| | | return sysEmbedmentGoodsService.alarmSet(embedmentGoodsDto); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/inventoryCorrection") |
| | | public BasicResult inventoryCorrection(EmbedmentGoodsDto embedmentGoodsDto){ |
| | | public BasicResult inventoryCorrection(@RequestBody EmbedmentGoodsDto embedmentGoodsDto){ |
| | | return sysEmbedmentGoodsService.inventoryCorrection(embedmentGoodsDto); |
| | | } |
| | | } |
| | |
| | | |
| | | private Integer pageSize; |
| | | |
| | | private String embedmentGoodsName; |
| | | private String embedmentName; |
| | | |
| | | private String companyId; |
| | | |
| | |
| | | public class EmbedmentRecordDto { |
| | | private String embedmentName; |
| | | private String embedmentId; |
| | | private String embedmentModel; |
| | | private String companyId; |
| | | private String supplierId; |
| | | private String getDepart; |
| | |
| | | package com.thhy.materials.modules.biz.embedment.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.thhy.general.annotations.Excel; |
| | | import com.thhy.general.annotations.Idkey; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | |
| | | /** |
| | | * |
| | | */ |
| | | @Idkey("id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 预埋件ID |
| | | */ |
| | | private String EmbedmentId; |
| | | private String embedmentId; |
| | | //预埋件名称 |
| | | private String EmbedmentName; |
| | | private String embedmentName; |
| | | //预埋件规格 |
| | | private String EmbedmentModel; |
| | | private String embedmentModel; |
| | | |
| | | @Excel(sort = 1,title = "预埋件名称") |
| | | private String embedmentNameAndModel; |
| | | |
| | | public String getEmbedmentNameAndModel() { |
| | | return embedmentName+"-"+embedmentModel; |
| | | } |
| | | |
| | | /** |
| | | * 1入库2出库 |
| | |
| | | /** |
| | | * 出库量/入库量 |
| | | */ |
| | | @Excel(sort = 2,title = "数量") |
| | | private Integer changeStock; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 单价 |
| | | */ |
| | | @Excel(sort = 3,title = "单价") |
| | | private BigDecimal singlePrice; |
| | | |
| | | /** |
| | | * 金额 |
| | | */ |
| | | @Excel(sort = 4,title = "金额") |
| | | private BigDecimal amount; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Excel(sort = 5,title = "备注") |
| | | private String remark; |
| | | |
| | | /** |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private String createTime; |
| | | |
| | | private String companyId; |
| | | /** |
| | | * This field was generated by MyBatis Generator. |
| | | * This field corresponds to the database table sys_assist_record |
| | |
| | | * @mbg.generated Tue Apr 11 09:37:48 CST 2023 |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author QiuYuHao |
| | |
| | | |
| | | SysEmbedmentGoodsEntity findEntity(String id); |
| | | |
| | | String embedmentNameAndType(@Param("embedmentGoodsName") String embedmentGoodsName, @Param("embedmentType") String embedmentType); |
| | | String embedmentNameAndType(@Param("embedmentName") String embedmentGoodsName, @Param("embedmentType") String embedmentType,@Param("embedmentModel")String embedmentModel); |
| | | |
| | | void alarmSet(EmbedmentGoodsDto embedmentGoodsDto); |
| | | |
| | | List<Map<String,Object>> getType(); |
| | | } |
| | |
| | | |
| | | BasicResult findAll(EmbedmentGoodsDto embedmentGoodsDto); |
| | | |
| | | BasicResult findAllDetails(String id); |
| | | |
| | | BasicResult findEntity(String id); |
| | | |
| | | void export(EmbedmentGoodsDto embedmentGoodsDto, HttpServletResponse response); |
| | |
| | | |
| | | BasicResult inventoryList(EmbedmentGoodsDto embedmentGoodsDto); |
| | | |
| | | BasicResult getType(); |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.materials.modules.biz.embedment.service; |
| | | |
| | | import com.thhy.general.common.BasicResult; |
| | | import com.thhy.materials.modules.biz.embedment.dto.EmbedmentRecordDto; |
| | | import com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @Author QiuYuHao |
| | | * @CreateDate 2023-09-22 16:27:16 |
| | | * 预埋件出入库接口 |
| | | */ |
| | | public interface SysEmbedmentRecordService { |
| | | BasicResult insert(SysEmbedmentRecordEntity sysEmbedmentRecordEntity); |
| | | |
| | | BasicResult embedmentRecordDel(String id); |
| | | |
| | | BasicResult update(SysEmbedmentRecordEntity sysEmbedmentRecordEntity); |
| | | |
| | | /** |
| | | * 入库列表 |
| | | * @param embedmentRecordDto |
| | | * @return |
| | | */ |
| | | BasicResult embedmentRecordList(EmbedmentRecordDto embedmentRecordDto); |
| | | |
| | | /** |
| | | * 出库列表 |
| | | * @param embedmentRecordDto |
| | | * @return |
| | | */ |
| | | BasicResult embedmentRecordOutList(EmbedmentRecordDto embedmentRecordDto); |
| | | |
| | | /** |
| | | * 查询单条 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | BasicResult embedmentRecordInfo(String id); |
| | | |
| | | void export(EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response); |
| | | |
| | | void recordExportTemplate(EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response); |
| | | |
| | | BasicResult variateExcel(MultipartFile file, HttpServletRequest request); |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author QiuYuHao |
| | |
| | | private SysEmbedmentCorrectionMapper sysEmbedmentCorrectionMapper; |
| | | |
| | | //=======================种类到此开始======================= |
| | | |
| | | @Override |
| | | public BasicResult getType() { |
| | | return BasicResult.success(sysEmbedmentGoodsMapper.getType()); |
| | | } |
| | | @Override |
| | | public BasicResult insert(SysEmbedmentGoodsEntity sysEmbedmentGoodsEntity) { |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | sysEmbedmentGoodsEntity.setCompanyId(sysUserInfo.getCompanyId()); |
| | | String embedmentName = sysEmbedmentGoodsEntity.getEmbedmentName(); |
| | | String embedmentType = sysEmbedmentGoodsEntity.getEmbedmentType(); |
| | | String id = sysEmbedmentGoodsMapper.embedmentNameAndType(embedmentName,embedmentType); |
| | | String embedmentModel = sysEmbedmentGoodsEntity.getEmbedmentModel(); |
| | | String id = sysEmbedmentGoodsMapper.embedmentNameAndType(embedmentName,embedmentType, embedmentModel); |
| | | if(!StringUtil.isEmpty(id)){ |
| | | return BasicResult.faild("11111","error","名称和规格型号不可重复"); |
| | | } |
| | |
| | | sysEmbedmentGoodsEntity.setCompanyId(sysUserInfo.getCompanyId()); |
| | | String embedmentName = sysEmbedmentGoodsEntity.getEmbedmentName(); |
| | | String embedmentType = sysEmbedmentGoodsEntity.getEmbedmentType(); |
| | | String id = sysEmbedmentGoodsMapper.embedmentNameAndType(embedmentName,embedmentType); |
| | | if(!StringUtil.isEmpty(id)){ |
| | | String embedmentModel = sysEmbedmentGoodsEntity.getEmbedmentModel(); |
| | | String id = sysEmbedmentGoodsMapper.embedmentNameAndType(embedmentName,embedmentType, embedmentModel); |
| | | if(!StringUtil.isEmpty(id) && !sysEmbedmentGoodsEntity.getId().equals(id)){ |
| | | return BasicResult.faild("11111","error","名称和规格型号不可重复"); |
| | | } |
| | | sysEmbedmentGoodsMapper.update(sysEmbedmentGoodsEntity); |
| | |
| | | return BasicResult.success(sysEmbedmentGoodsMapper.findEntity(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public BasicResult findAllDetails(String id) { |
| | | return BasicResult.success(sysEmbedmentGoodsMapper.findEntity(id).getEmbedmentModel()); |
| | | } |
| | | //=======================种类到此结束======================= |
| | | |
| | | //=======================库存管理开始======================= |
| | |
| | | PageInfo<SysEmbedmentCorrectionEntity> pageInfo = new PageInfo<>(sysEmbedmentCorrectionEntities); |
| | | return BasicResult.success(pageInfo); |
| | | } |
| | | |
| | | //=======================校正记录结束======================= |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.materials.modules.biz.embedment.service.impl; |
| | | |
| | | import cn.hutool.core.text.StrBuilder; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.thhy.general.common.BasicMessage; |
| | | import com.thhy.general.common.BasicResult; |
| | | import com.thhy.general.config.SysUserInfo; |
| | | import com.thhy.general.exception.BasicException; |
| | | import com.thhy.general.utils.ExcelUtils; |
| | | import com.thhy.general.utils.UserInfoUtils; |
| | | import com.thhy.materials.modules.biz.embedment.dto.EmbedmentRecordDto; |
| | | import com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentGoodsEntity; |
| | | import com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity; |
| | | import com.thhy.materials.modules.biz.embedment.mapper.SysEmbedmentGoodsMapper; |
| | | import com.thhy.materials.modules.biz.embedment.mapper.SysEmbedmentRecordMapper; |
| | | import com.thhy.materials.modules.biz.embedment.service.SysEmbedmentRecordService; |
| | | import com.thhy.materials.modules.biz.materials.entity.SysAssistGood; |
| | | import com.thhy.materials.modules.biz.utils.ExcelUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.ss.usermodel.DataValidation; |
| | | import org.apache.poi.ss.usermodel.DataValidationConstraint; |
| | | import org.apache.poi.ss.usermodel.DataValidationHelper; |
| | | import org.apache.poi.ss.util.CellRangeAddressList; |
| | | import org.apache.poi.util.IOUtils; |
| | | import org.apache.poi.xssf.usermodel.XSSFRow; |
| | | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @Author QiuYuHao |
| | | * @CreateDate 2023-09-22 16:28:24 |
| | | * 预埋件出入库实现 |
| | | */ |
| | | @Service |
| | | public class SysEmbedmentRecordServiceImpl implements SysEmbedmentRecordService{ |
| | | |
| | | @Autowired |
| | | private SysEmbedmentRecordMapper sysEmbedmentRecordMapper; |
| | | |
| | | @Autowired |
| | | private SysEmbedmentGoodsMapper sysEmbedmentGoodsMapper; |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BasicResult insert(SysEmbedmentRecordEntity sysEmbedmentRecordEntity) { |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | sysEmbedmentRecordEntity.setCreateUser(sysUserInfo.getRealName()); |
| | | sysEmbedmentRecordEntity.setCompanyId(sysUserInfo.getCompanyId()); |
| | | SysEmbedmentGoodsEntity entity = sysEmbedmentGoodsMapper.findEntity(sysEmbedmentRecordEntity.getEmbedmentId()); |
| | | if(entity!=null){ |
| | | String stockType = sysEmbedmentRecordEntity.getStockType(); |
| | | //stockType 1入库 2出库 |
| | | int result = entity.getStock(); |
| | | if("1".equals(stockType)){ |
| | | result= entity.getStock() + sysEmbedmentRecordEntity.getChangeStock(); |
| | | }else{ |
| | | result= entity.getStock() - sysEmbedmentRecordEntity.getChangeStock(); |
| | | } |
| | | if(result < 0 ){ |
| | | return BasicResult.faild("11111","库存不足","库存不足"); |
| | | } |
| | | entity.setStock(result); |
| | | sysEmbedmentGoodsMapper.update(entity);//更改库存 |
| | | }else { |
| | | return BasicResult.faild("11111","库存没有该预埋件,请到【预埋件种类】添加","库存没有该预埋件,请到【预埋件种类】添加"); |
| | | } |
| | | sysEmbedmentRecordMapper.insert(sysEmbedmentRecordEntity); |
| | | return BasicResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public BasicResult embedmentRecordDel(String id) { |
| | | sysEmbedmentRecordMapper.embedmentRecordDel(id); |
| | | return BasicResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BasicResult update(SysEmbedmentRecordEntity sysEmbedmentRecordEntity) { |
| | | String id = sysEmbedmentRecordEntity.getId();//记录id |
| | | String embedmentId = sysEmbedmentRecordEntity.getEmbedmentId();//库存id |
| | | SysEmbedmentRecordEntity queryRecordData = sysEmbedmentRecordMapper.embedmentRecordInfo(id);//查询到的记录 |
| | | Integer dataChangeStock = queryRecordData.getChangeStock();//拿到修改前的入库数量 |
| | | Integer paramChangeStock = sysEmbedmentRecordEntity.getChangeStock();//当前传输入库数量 |
| | | Integer nowChangeStock = paramChangeStock - dataChangeStock;//当前传的和库里的取差值 |
| | | SysEmbedmentGoodsEntity entity = sysEmbedmentGoodsMapper.findEntity(embedmentId); |
| | | Integer resultStock = entity.getStock() + nowChangeStock; |
| | | entity.setStock(resultStock); |
| | | sysEmbedmentGoodsMapper.update(entity); |
| | | sysEmbedmentRecordMapper.update(sysEmbedmentRecordEntity); |
| | | return BasicResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public BasicResult embedmentRecordList(EmbedmentRecordDto embedmentRecordDto) { |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | embedmentRecordDto.setCompanyId(sysUserInfo.getCompanyId()); |
| | | PageHelper.startPage(embedmentRecordDto.getPageNum(),embedmentRecordDto.getPageSize()); |
| | | List<SysEmbedmentRecordEntity> sysEmbedmentRecordEntities = sysEmbedmentRecordMapper.embedmentRecordList(embedmentRecordDto); |
| | | PageInfo<SysEmbedmentRecordEntity> info = new PageInfo<>(sysEmbedmentRecordEntities); |
| | | return BasicResult.success(info); |
| | | } |
| | | |
| | | @Override |
| | | public BasicResult embedmentRecordOutList(EmbedmentRecordDto embedmentRecordDto) { |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | embedmentRecordDto.setCompanyId(sysUserInfo.getCompanyId()); |
| | | PageHelper.startPage(embedmentRecordDto.getPageNum(),embedmentRecordDto.getPageSize()); |
| | | List<SysEmbedmentRecordEntity> sysEmbedmentRecordEntities = sysEmbedmentRecordMapper.embedmentRecordOutList(embedmentRecordDto); |
| | | PageInfo<SysEmbedmentRecordEntity> info = new PageInfo<>(sysEmbedmentRecordEntities); |
| | | return BasicResult.success(info); |
| | | } |
| | | |
| | | @Override |
| | | public BasicResult embedmentRecordInfo(String id) { |
| | | return BasicResult.success(sysEmbedmentRecordMapper.embedmentRecordInfo(id)); |
| | | } |
| | | |
| | | @Override |
| | | public void export(EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response) { |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | embedmentRecordDto.setCompanyId(sysUserInfo.getCompanyId()); |
| | | List<SysEmbedmentRecordEntity> sysEmbedmentRecordEntities = sysEmbedmentRecordMapper.embedmentRecordList(embedmentRecordDto); |
| | | ExcelUtils.downExcel(sysEmbedmentRecordEntities,SysEmbedmentRecordEntity.class,response,"预埋件入库"); |
| | | } |
| | | |
| | | @Override |
| | | public void recordExportTemplate(EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response) { |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | String companyId = sysUserInfo.getCompanyId(); |
| | | XSSFWorkbook book = new XSSFWorkbook(); |
| | | XSSFSheet sheet = book.createSheet(); |
| | | XSSFRow row = sheet.createRow(0); |
| | | row.createCell(0).setCellValue("物品名称-规格型号"); |
| | | row.createCell(1).setCellValue("入库数量"); |
| | | row.createCell(2).setCellValue("单价"); |
| | | row.createCell(3).setCellValue("金额"); |
| | | row.createCell(4).setCellValue("备注"); |
| | | embedmentRecordDto.setCompanyId(companyId); |
| | | List<String> lx = sysEmbedmentRecordMapper.embedmentRecordList(embedmentRecordDto).stream().map(s -> s.getEmbedmentNameAndModel()).collect(Collectors.toList()); |
| | | String[] gjlx = lx.toArray(new String[lx.size()]); |
| | | |
| | | //物品名称-规格型号 |
| | | CellRangeAddressList regions1 = new CellRangeAddressList(1, 500, 0, 0); |
| | | DataValidationHelper dataValidationHelper = sheet.getDataValidationHelper(); |
| | | DataValidationConstraint createExplicitListConstraint1 = dataValidationHelper.createExplicitListConstraint(gjlx); |
| | | DataValidation createValidation1 = dataValidationHelper.createValidation(createExplicitListConstraint1, regions1); |
| | | sheet.addValidationData(createValidation1); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=test.xls"); |
| | | OutputStream out = null; |
| | | try { |
| | | out = response.getOutputStream(); |
| | | book.write(out); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | IOUtils.closeQuietly(out); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BasicResult variateExcel(MultipartFile file, HttpServletRequest request) { |
| | | List<List<Object>> lists = null;//去工具类处理,返回excel中的数据 |
| | | try { |
| | | lists = ExcelUtil.getUserListByExcel(file.getInputStream(), file.getOriginalFilename()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.remove(0); |
| | | if (lists.size()>0){ |
| | | for (List<Object> list :lists){ |
| | | String embedmentNameAndModel = list.get(0).toString(); |
| | | String[] split = embedmentNameAndModel.split("-"); |
| | | String embedmentName = split[0]; |
| | | StringBuilder embedmentModel = new StringBuilder(); |
| | | for (int i = 1; i < split.length; i++) { |
| | | if (StringUtils.isBlank(embedmentModel)){ |
| | | embedmentModel.append(split[i]); |
| | | }else { |
| | | embedmentModel.append("-"+split[i]); |
| | | } |
| | | |
| | | } |
| | | String id = sysEmbedmentGoodsMapper.embedmentNameAndType(embedmentName,null, embedmentModel.toString()); |
| | | if(StringUtils.isBlank(id)) { |
| | | throw new BasicException(new BasicMessage("500","库存没有【"+embedmentName+"】,请到预埋件种类新增,新增完可重新导入!")); |
| | | } |
| | | SysEmbedmentRecordEntity sysEmbedmentRecordEntity = new SysEmbedmentRecordEntity(); |
| | | sysEmbedmentRecordEntity.setEmbedmentId(id); |
| | | //入库数量 |
| | | Integer changeStock = Integer.valueOf(list.get(1).toString()); |
| | | sysEmbedmentRecordEntity.setChangeStock(changeStock); |
| | | //单价 |
| | | String dj = list.get(2).toString(); |
| | | BigDecimal singlePrice = new BigDecimal(dj); |
| | | sysEmbedmentRecordEntity.setSinglePrice(singlePrice); |
| | | //金额 |
| | | String je = list.get(3).toString(); |
| | | BigDecimal amount = new BigDecimal(je); |
| | | sysEmbedmentRecordEntity.setAmount(amount); |
| | | //备注 |
| | | String remark = list.get(4).toString(); |
| | | sysEmbedmentRecordEntity.setRemark(remark); |
| | | //入库人 |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | String companyId = sysUserInfo.getCompanyId(); |
| | | sysEmbedmentRecordEntity.setCreateUser(sysUserInfo.getRealName()); |
| | | sysEmbedmentRecordEntity.setCompanyId(companyId); |
| | | //stockType 1入库 |
| | | sysEmbedmentRecordEntity.setStockType("1"); |
| | | SysEmbedmentGoodsEntity entity = sysEmbedmentGoodsMapper.findEntity(sysEmbedmentRecordEntity.getEmbedmentId()); |
| | | if(entity!=null){ |
| | | int result = entity.getStock() + sysEmbedmentRecordEntity.getChangeStock(); |
| | | entity.setStock(result); |
| | | sysEmbedmentGoodsMapper.update(entity);//更改库存 |
| | | }else { |
| | | throw new BasicException(new BasicMessage("500","库存没有【"+embedmentName+"】,请到预埋件种类新增,新增完可重新导入!")); |
| | | } |
| | | sysEmbedmentRecordMapper.insert(sysEmbedmentRecordEntity); |
| | | } |
| | | return BasicResult.success("导入成功"); |
| | | }else { |
| | | return BasicResult.faild("11111","error","空文件"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | server: |
| | | port: 8892 |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | | - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
对比新文件 |
| | |
| | | <?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.thhy.materials.modules.biz.embedment.mapper.SysEmbedmentCorrectionMapper"> |
| | | |
| | | <insert id="insert" > |
| | | insert into sys_embedment_correction |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="embedmentId != null"> |
| | | embedment_id, |
| | | </if> |
| | | <if test="correctionBefore != null"> |
| | | correction_before, |
| | | </if> |
| | | <if test="correctionNum != null"> |
| | | correction_num, |
| | | </if> |
| | | <if test="correctionAfter != null"> |
| | | correction_after, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | create_user, |
| | | </if> |
| | | <if test="remark != null"> |
| | | remark, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="embedmentId != null"> |
| | | #{embedmentId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="correctionBefore != null"> |
| | | #{correctionBefore,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="correctionNum != null"> |
| | | #{correctionNum,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="correctionAfter != null"> |
| | | #{correctionAfter,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | #{createUser,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <select id="inventoryList" resultType="com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentCorrectionEntity"> |
| | | select |
| | | sac.id, |
| | | sac.embedment_id as embedmentId, |
| | | sac.correction_before as correctionBefore, |
| | | sac.correction_num as correctionNum, |
| | | sac.correction_after as correctionAfter, |
| | | sac.create_time as createTime, |
| | | sac.create_user as createUser, |
| | | sac.remark as remark, |
| | | sag.embedment_name as embedmentName, |
| | | sag.embedment_model as embedmentModel, |
| | | sag.unit |
| | | from sys_embedment_correction sac |
| | | left join sys_embedment_goods sag on sac.embedment_id=sag.id |
| | | where 1=1 |
| | | <if test="embedmentName!=null and embedmentName!='' "> |
| | | and sag.embedment_name like concat('%',#{embedmentName},'%') |
| | | </if> |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and sag.company_id=#{companyId} |
| | | </if> |
| | | order by sac.create_time desc |
| | | |
| | | </select> |
| | | <select id="assistRecordList" resultType="com.thhy.materials.modules.biz.materials.entity.SysAssistRecord"> |
| | | select sar.id, |
| | | sar.assist_id as assistId, |
| | | sar.stock_type as stockType, |
| | | sar.change_stock as changeStock, |
| | | sar.supplier_id as supplierId, |
| | | sar.single_price as singlePrice, |
| | | sar.amount as amount, |
| | | sar.remark as remark, |
| | | sar.get_depart as getDepart, |
| | | sar.create_user as createUser, |
| | | sar.create_time as createTime, |
| | | sar.is_use as isUse, |
| | | sag.assist_name as assistName, |
| | | sag.assist_model as assistModel, |
| | | ss.supplier_name as supplierName, |
| | | su.real_name as realName |
| | | from sys_assist_record sar |
| | | left join sys_assist_good sag on sar.assist_id=sag.id |
| | | left join sys_supplier ss on sar.supplier_id=ss.id |
| | | left join sys_users su on su.user_id=sar.create_user |
| | | where sar.is_use=1 and sar.stock_type=1 |
| | | <if test="assistName!=null and assistName!='' "> |
| | | and sag.assist_name like concat('%',#{assistName},'%') |
| | | </if> |
| | | <if test="assistId!=null and assistId!='' "> |
| | | and sar.assist_id=#{assistId} |
| | | </if> |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and sar.company_id=#{companyId} |
| | | </if> |
| | | <if test="realName!=null and realName!='' "> |
| | | and su.real_name like concat('%',#{realName},'%') |
| | | </if> |
| | | <if test="supplierId!=null and supplierId!='' "> |
| | | and sar.supplier_id=#{supplierId} |
| | | </if> |
| | | <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> |
| | | and sar.create_time between #{strTime}and #{endTime} |
| | | </if> |
| | | order by sar.create_time desc |
| | | </select> |
| | | <select id="assistRecordOutList" resultType="com.thhy.materials.modules.biz.materials.entity.SysAssistRecord"> |
| | | select |
| | | sar.id, |
| | | sar.assist_id as assistId, |
| | | sar.stock_type as stockType, |
| | | sar.change_stock as changeStock, |
| | | sar.supplier_id as supplierId, |
| | | sar.single_price as singlePrice, |
| | | sar.amount as amount, |
| | | sar.remark as remark, |
| | | sar.get_depart as getDepart, |
| | | sar.create_user as createUser, |
| | | sar.create_time as createTime, |
| | | sar.is_use as isUse, |
| | | sag.assist_name as assistName, |
| | | sag.assist_model as assistModel, |
| | | su.real_name as realName, |
| | | sd.depart_name as departName from sys_assist_record sar |
| | | left join sys_assist_good sag on sar.assist_id=sag.id |
| | | left join sys_users su on su.user_id=sar.create_user |
| | | left join sys_depart sd on sd.depart_id=sar.get_depart |
| | | where sar.is_use=1 and sar.stock_type=2 |
| | | <if test="assistName!=null and assistName!='' "> |
| | | and sag.assist_name like concat('%',#{assistName},'%') |
| | | </if> |
| | | <if test="assistId!=null and assistId!='' "> |
| | | and sar.assist_id=#{assistId} |
| | | </if> |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and sar.company_id=#{companyId} |
| | | </if> |
| | | <if test="realName!=null and realName!='' "> |
| | | and su.real_name like concat('%',#{realName},'%') |
| | | </if> |
| | | <if test="supplierId!=null and supplierId!='' "> |
| | | and sar.supplier_id=#{supplierId} |
| | | </if> |
| | | <if test="getDepart!=null and getDepart!='' "> |
| | | and sd.depart_name like concat('%',#{getDepart},'%') |
| | | </if> |
| | | <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> |
| | | and sar.create_time between #{strTime} and #{endTime} |
| | | </if> |
| | | order by sar.create_time desc |
| | | </select> |
| | | <select id="assistRecordInfo" parameterType="java.lang.String" resultType="com.thhy.materials.modules.biz.materials.entity.SysAssistRecord"> |
| | | select |
| | | sar.id, |
| | | sar.assist_id as assistId, |
| | | sar.stock_type as stockType, |
| | | sar.change_stock as changeStock, |
| | | sar.supplier_id as supplierId, |
| | | sar.single_price as singlePrice, |
| | | sar.amount as amount, |
| | | sar.remark as remark, |
| | | sar.get_depart as getDepart, |
| | | sar.create_user as createUser, |
| | | sar.create_time as createTime, |
| | | sar.is_use as isUse, |
| | | sag.assist_name as assistName, |
| | | sag.assist_model as assistModel, |
| | | ss.supplier_name as supplierName, |
| | | su.real_name as realName from sys_assist_record sar |
| | | left join sys_assist_good sag on sar.assist_id=sag.id |
| | | left join sys_supplier ss on sar.supplier_id=ss.id |
| | | left join sys_users su on su.user_id=sar.create_user |
| | | where sar.is_use=1 and sar.id=#{id} |
| | | </select> |
| | | |
| | | <select id="assistIdSelect" parameterType="java.lang.String" resultType="com.thhy.materials.modules.biz.materials.entity.SysAssistRecord"> |
| | | select |
| | | sar.id, |
| | | sar.assist_id as assistId, |
| | | sar.stock_type as stockType, |
| | | sar.change_stock as changeStock, |
| | | sar.supplier_id as supplierId, |
| | | sar.single_price as singlePrice, |
| | | sar.amount as amount, |
| | | sar.remark as remark, |
| | | sar.get_depart as getDepart, |
| | | sar.create_user as createUser, |
| | | sar.create_time as createTime, |
| | | sar.is_use as isUse |
| | | from sys_assist_record sar where sar.id=#{id} |
| | | </select> |
| | | <update id="assistRecordDel" > |
| | | update sys_assist_record set |
| | | is_use=2 |
| | | where id=#{id} |
| | | </update> |
| | | <insert id="assistCheckInsert"> |
| | | insert into sys_assist_correction |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="assistId != null"> |
| | | assist_id, |
| | | </if> |
| | | <if test="correctionBefore != null"> |
| | | correction_before, |
| | | </if> |
| | | <if test="correctionNum != null"> |
| | | correction_num, |
| | | </if> |
| | | <if test="correctionAfter != null"> |
| | | correction_after, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | create_user, |
| | | </if> |
| | | <if test="remark != null"> |
| | | remark, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="assistId != null"> |
| | | #{assistId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="correctionBefore != null"> |
| | | #{correctionBefore,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="correctionNum != null"> |
| | | #{correctionNum,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="correctionAfter != null"> |
| | | #{correctionAfter,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | #{createUser,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <select id="assistCorrectionList" resultType="com.thhy.materials.modules.biz.materials.entity.SysAssistCorrection"> |
| | | select sac.id, |
| | | sac.assist_id as assistId, |
| | | sac.correction_before as correctionBefore, |
| | | sac.correction_num as correctionNum, |
| | | sac.correction_after as correctionAfter, |
| | | sac.create_time as createTime, |
| | | sac.create_user as createUser, |
| | | sac.remark as remark, |
| | | sag.assist_name as assistName, |
| | | sag.assist_model as assistModel, |
| | | sag.unit, |
| | | su.real_name as realName |
| | | from sys_assist_correction sac |
| | | left join sys_assist_good sag on sac.assist_id=sag.id |
| | | left join sys_users su on su.user_id=sac.create_user |
| | | where 1=1 |
| | | <if test="assistName!=null and assistName!='' "> |
| | | and sag.assist_name like concat('%',#{assistName},'%') |
| | | </if> |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and sag.company_id=#{companyId} |
| | | </if> |
| | | order by sac.create_time desc |
| | | </select> |
| | | |
| | | <select id="assistStatisticsDay" resultType="com.thhy.materials.modules.biz.materials.entity.dto.AssistStatisticsDto"> |
| | | SELECT |
| | | sar.assist_id AS assistId, |
| | | sag.assist_name AS assistName, |
| | | sag.assist_model AS assistModel, |
| | | DATE( sar.create_time ) AS getDate, |
| | | SUM( sar.change_stock ) AS changeStock |
| | | FROM |
| | | sys_assist_record sar |
| | | LEFT JOIN sys_assist_good sag ON sar.assist_id = sag.id |
| | | WHERE |
| | | sar.stock_type = 2 |
| | | AND sar.is_use = 1 |
| | | <if test="assistId!=null and assistId!='' "> |
| | | and sar.assist_id=#{assistId} |
| | | </if> |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and sag.company_id=#{companyId} |
| | | </if> |
| | | <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> |
| | | and DATE( sar.create_time ) between #{strTime} and #{endTime} |
| | | </if> |
| | | GROUP BY |
| | | DATE( sar.create_time ), |
| | | sar.assist_id |
| | | </select> |
| | | <select id="assistStatisticsMonth" resultType="com.thhy.materials.modules.biz.materials.entity.dto.AssistStatisticsDto"> |
| | | SELECT |
| | | sar.assist_id AS assistId, |
| | | sag.assist_name AS assistName, |
| | | sag.assist_model AS assistModel, |
| | | CONCAT( |
| | | CONCAT( YEAR ( sar.create_time ), '-' ), |
| | | IF |
| | | ( MONTH ( sar.create_time )> 9, MONTH ( sar.create_time ), CONCAT( '0', MONTH ( sar.create_time )) )) AS getDate, |
| | | SUM( sar.change_stock ) AS changeStock |
| | | FROM |
| | | sys_assist_record sar |
| | | LEFT JOIN sys_assist_good sag ON sar.assist_id = sag.id |
| | | WHERE |
| | | sar.stock_type = 2 |
| | | AND sar.is_use = 1 |
| | | <if test="assistId!=null and assistId!='' "> |
| | | and sar.assist_id=#{assistId} |
| | | </if> |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and sag.company_id=#{companyId} |
| | | </if> |
| | | <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> |
| | | and CONCAT( |
| | | CONCAT( YEAR ( sar.create_time ), '-' ), |
| | | IF |
| | | ( MONTH ( sar.create_time )> 9, MONTH ( sar.create_time ), CONCAT( '0', MONTH ( sar.create_time )) )) between #{strTime} and #{endTime} |
| | | </if> |
| | | GROUP BY |
| | | CONCAT( |
| | | CONCAT( YEAR ( sar.create_time ), '-' ), |
| | | IF |
| | | ( MONTH ( sar.create_time )> 9, MONTH ( sar.create_time ), CONCAT( '0', MONTH ( sar.create_time )) )), |
| | | sar.assist_id |
| | | |
| | | </select> |
| | | <select id="assistRecordPull" parameterType="java.lang.String" resultType="com.thhy.materials.modules.biz.materials.entity.dto.AssistGoodPullDto"> |
| | | SELECT |
| | | id AS assistId, |
| | | assist_name AS assistName, |
| | | assist_model AS assistModel |
| | | FROM |
| | | sys_assist_good |
| | | WHERE |
| | | is_use =1 |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and company_id=#{companyId} |
| | | </if> |
| | | </select> |
| | | <select id="assistRecordPullS" resultType="com.thhy.materials.modules.biz.materials.entity.dto.AssistGoodPullDto"> |
| | | SELECT |
| | | id AS assistId, |
| | | assist_name AS assistName, |
| | | assist_model AS assistModel |
| | | FROM |
| | | sys_assist_good |
| | | WHERE |
| | | is_use =1 |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and company_id=#{companyId} |
| | | </if> |
| | | <if test="assistId!=null and assistId!='' "> |
| | | and id=#{assistId} |
| | | </if> |
| | | </select> |
| | | </mapper> |
对比新文件 |
| | |
| | | <?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.thhy.materials.modules.biz.embedment.mapper.SysEmbedmentGoodsMapper"> |
| | | <resultMap id="BaseResultMap" type="com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentGoodsEntity"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | This element is automatically generated by MyBatis Generator, do not modify. |
| | | This element was generated on Tue Apr 11 08:58:47 CST 2023. |
| | | --> |
| | | <id column="id" jdbcType="VARCHAR" property="id" /> |
| | | <result column="embedment_name" jdbcType="VARCHAR" property="embedmentName" /> |
| | | <result column="embedment_type" jdbcType="VARCHAR" property="embedmentType" /> |
| | | <result column="embedment_model" jdbcType="VARCHAR" property="embedmentModel" /> |
| | | <result column="unit" jdbcType="VARCHAR" property="unit" /> |
| | | <result column="stock" jdbcType="INTEGER" property="stock" /> |
| | | <result column="position" jdbcType="VARCHAR" property="position" /> |
| | | <result column="alarm_count" jdbcType="INTEGER" property="alarmCount" /> |
| | | <result column="is_use" jdbcType="INTEGER" property="isUse" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | <result column="create_user" jdbcType="VARCHAR" property="createUser" /> |
| | | </resultMap> |
| | | <select id="embedmentNameAndType" resultType="java.lang.String"> |
| | | select id from sys_embedment_goods where is_use=1 |
| | | <if test="embedmentName != null"> |
| | | and embedment_name=#{embedmentName} |
| | | </if> |
| | | <if test="embedmentType != null"> |
| | | and embedment_type=#{embedmentType} |
| | | </if> |
| | | <if test="embedmentModel != null"> |
| | | and embedment_model=#{embedmentModel} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | <insert id="insert" > |
| | | insert into sys_embedment_goods |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="embedmentName != null"> |
| | | embedment_name, |
| | | </if> |
| | | <if test="embedmentType != null"> |
| | | embedment_type, |
| | | </if> |
| | | <if test="embedmentModel != null"> |
| | | embedment_model, |
| | | </if> |
| | | <if test="unit != null"> |
| | | unit, |
| | | </if> |
| | | <if test="stock != null"> |
| | | stock, |
| | | </if> |
| | | <if test="position != null"> |
| | | `position`, |
| | | </if> |
| | | <if test="alarmCount != null"> |
| | | alarm_count, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | is_use, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | create_user, |
| | | </if> |
| | | <if test="remark != null"> |
| | | remark, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | company_id, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="embedmentName != null"> |
| | | #{embedmentName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="embedmentType != null"> |
| | | #{embedmentType,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="embedmentModel != null"> |
| | | #{embedmentModel,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="unit != null"> |
| | | #{unit,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="stock != null"> |
| | | #{stock,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="position != null"> |
| | | #{position,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="alarmCount != null"> |
| | | #{alarmCount,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | #{isUse,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | #{createUser,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | #{companyId,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <select id="findAll" resultType="com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentGoodsEntity"> |
| | | select sag.id, |
| | | sag.embedment_name as embedmentName, |
| | | sag.embedment_type as embedmentType, |
| | | sag.embedment_model as embedmentModel, |
| | | sag.unit as unit, |
| | | sag.stock as stock, |
| | | sag.position as 'position', |
| | | sag.alarm_count as alarmCount, |
| | | sag.is_use as isUse, |
| | | sag.create_time as createTime, |
| | | sag.remark as remark, |
| | | sd.dict_name as dictName |
| | | from sys_embedment_goods sag |
| | | left join sys_dict sd on sag.embedment_type=sd.dict_id |
| | | where sag.is_use=1 |
| | | <if test="embedmentName!=null and embedmentName!='' "> |
| | | and sag.embedment_name like concat('%',#{embedmentName},'%') |
| | | </if> |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and sag.company_id=#{companyId} |
| | | </if> |
| | | <if test="id!=null and id!='' "> |
| | | and sag.id=#{id} |
| | | </if> |
| | | |
| | | order by sag.create_time desc |
| | | </select> |
| | | <select id="findEntity" parameterType="java.lang.String" resultType="com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentGoodsEntity"> |
| | | select sag.id, |
| | | sag.embedment_name as embedmentName, |
| | | sag.embedment_type as embedmentType, |
| | | sag.embedment_model as embedmentModel, |
| | | sag.unit as unit, |
| | | sag.stock as stock, |
| | | sag.position as 'position', |
| | | sag.alarm_count as alarmCount, |
| | | sag.is_use as isUse, |
| | | sag.create_time as createTime, |
| | | sag.remark as remark, |
| | | sd.dict_name as dictName from sys_embedment_goods sag left join sys_dict sd |
| | | on sag.embedment_type=sd.dict_id |
| | | where sag.is_use=1 and sag.id=#{id} |
| | | </select> |
| | | <update id="delete" parameterType="java.lang.String" > |
| | | update sys_embedment_goods set |
| | | is_use=2 |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="alarmSet"> |
| | | update sys_embedment_goods set alarm_count = #{alarmCount} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <select id="getType" resultType="java.util.Map"> |
| | | select |
| | | sd.dict_id as dictId, |
| | | sd.dict_type as dictType, |
| | | sd.dict_name as dictName, |
| | | sd.dict_value as dictValue, |
| | | sd.colors as colors, |
| | | sd.create_time as createTime, |
| | | sdt.dict_type_name as dictTypeName |
| | | from sys_dict sd |
| | | left join sys_dict_type sdt on sd.dict_type=sdt.dict_type |
| | | where |
| | | sd.is_use = 1 |
| | | and sd.dict_type='embedment' |
| | | </select> |
| | | <update id="update" > |
| | | update sys_embedment_goods |
| | | <set> |
| | | <if test="embedmentName != null"> |
| | | embedment_name = #{embedmentName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="embedmentType != null"> |
| | | embedment_type = #{embedmentType,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="embedmentModel != null"> |
| | | embedment_model = #{embedmentModel,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="unit != null"> |
| | | unit = #{unit,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="stock != null"> |
| | | stock = #{stock,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="position != null"> |
| | | position = #{position,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="alarmCount != null"> |
| | | alarm_count = #{alarmCount,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | is_use = #{isUse,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | create_user = #{createUser,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=VARCHAR} |
| | | </update> |
| | | |
| | | </mapper> |
对比新文件 |
| | |
| | | <?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.thhy.materials.modules.biz.embedment.mapper.SysEmbedmentRecordMapper"> |
| | | <resultMap id="BaseResultMap" type="com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | This element is automatically generated by MyBatis Generator, do not modify. |
| | | This element was generated on Tue Apr 11 09:37:48 CST 2023. |
| | | --> |
| | | <id column="id" jdbcType="VARCHAR" property="id" /> |
| | | <result column="embedment_id" jdbcType="VARCHAR" property="embedmentId" /> |
| | | <result column="stock_type" jdbcType="VARCHAR" property="stockType" /> |
| | | <result column="change_stock" jdbcType="INTEGER" property="changeStock" /> |
| | | <result column="supplier_id" jdbcType="VARCHAR" property="supplierId" /> |
| | | <result column="single_price" jdbcType="DECIMAL" property="singlePrice" /> |
| | | <result column="amount" jdbcType="DECIMAL" property="amount" /> |
| | | <result column="remark" jdbcType="VARCHAR" property="remark" /> |
| | | <result column="get_depart" jdbcType="VARCHAR" property="getDepart" /> |
| | | <result column="create_user" jdbcType="VARCHAR" property="createUser" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <update id="update" > |
| | | update sys_embedment_record |
| | | <set> |
| | | <if test="embedmentId != null"> |
| | | embedment_id = #{embedmentId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="stockType != null"> |
| | | stock_type = #{stockType,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="changeStock != null"> |
| | | change_stock = #{changeStock,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="supplierId != null"> |
| | | supplier_id = #{supplierId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="singlePrice != null"> |
| | | single_price = #{singlePrice,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount = #{amount,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="getDepart != null"> |
| | | get_depart = #{getDepart,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | create_user = #{createUser,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | company_id = #{companyId,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=VARCHAR} |
| | | </update> |
| | | |
| | | <insert id="insert" > |
| | | insert into sys_embedment_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="embedmentId != null"> |
| | | embedment_id, |
| | | </if> |
| | | <if test="stockType != null"> |
| | | stock_type, |
| | | </if> |
| | | <if test="changeStock != null"> |
| | | change_stock, |
| | | </if> |
| | | <if test="supplierId != null"> |
| | | supplier_id, |
| | | </if> |
| | | <if test="singlePrice != null"> |
| | | single_price, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount, |
| | | </if> |
| | | <if test="remark != null"> |
| | | remark, |
| | | </if> |
| | | <if test="getDepart != null"> |
| | | get_depart, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | create_user, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | company_id, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="embedmentId != null"> |
| | | #{embedmentId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="stockType != null"> |
| | | #{stockType,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="changeStock != null"> |
| | | #{changeStock,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="supplierId != null"> |
| | | #{supplierId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="singlePrice != null"> |
| | | #{singlePrice,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | #{amount,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="getDepart != null"> |
| | | #{getDepart,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | #{createUser,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | #{companyId,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <select id="embedmentRecordList" resultType="com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity"> |
| | | select |
| | | CONCAT(seg.embedment_name,"-",seg.embedment_model) embedmentNameAndModel, |
| | | ser.id, |
| | | ser.embedment_id as embedmentId, |
| | | ser.stock_type as stockType, |
| | | ser.change_stock as changeStock, |
| | | ser.supplier_id as supplierId, |
| | | ser.single_price as singlePrice, |
| | | ser.amount as amount, |
| | | ser.remark as remark, |
| | | ser.get_depart as getDepart, |
| | | ser.create_user as createUser, |
| | | ser.create_time as createTime, |
| | | ser.is_use as isUse, |
| | | seg.embedment_name as embedmentName, |
| | | seg.embedment_model as embedmentModel, |
| | | sd.depart_name as departName |
| | | from sys_embedment_record ser |
| | | left join sys_embedment_goods seg on ser.embedment_id=seg.id |
| | | left join sys_depart sd on sd.depart_id=ser.get_depart |
| | | where ser.is_use=1 and ser.stock_type=1 |
| | | <if test="embedmentName!=null and embedmentName!='' "> |
| | | and seg.embedment_name like concat('%',#{embedmentName},'%') |
| | | </if> |
| | | <if test="embedmentId!=null and embedmentId!='' "> |
| | | and ser.embedment_id=#{embedmentId} |
| | | </if> |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and ser.company_id=#{companyId} |
| | | </if> |
| | | <if test="supplierId!=null and supplierId!='' "> |
| | | and ser.supplier_id=#{supplierId} |
| | | </if> |
| | | <if test="getDepart!=null and getDepart!='' "> |
| | | and sd.depart_name like concat('%',#{getDepart},'%') |
| | | </if> |
| | | <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> |
| | | and ser.create_time between #{strTime} and #{endTime} |
| | | </if> |
| | | order by ser.create_time desc |
| | | </select> |
| | | <select id="embedmentRecordOutList" resultType="com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity"> |
| | | select |
| | | ser.id, |
| | | ser.embedment_id as embedmentId, |
| | | ser.stock_type as stockType, |
| | | ser.change_stock as changeStock, |
| | | ser.supplier_id as supplierId, |
| | | ser.single_price as singlePrice, |
| | | ser.amount as amount, |
| | | ser.remark as remark, |
| | | ser.get_depart as getDepart, |
| | | ser.create_user as createUser, |
| | | ser.create_time as createTime, |
| | | ser.is_use as isUse, |
| | | seg.embedment_name as embedmentName, |
| | | seg.embedment_model as embedmentModel, |
| | | sd.depart_name as departName |
| | | from sys_embedment_record ser |
| | | left join sys_embedment_goods seg on ser.embedment_id=seg.id |
| | | left join sys_depart sd on sd.depart_id=ser.get_depart |
| | | where ser.is_use=1 and ser.stock_type=2 |
| | | <if test="embedmentName!=null and embedmentName!='' "> |
| | | and seg.embedment_name like concat('%',#{embedmentName},'%') |
| | | </if> |
| | | <if test="embedmentId!=null and embedmentId!='' "> |
| | | and ser.embedment_id=#{embedmentId} |
| | | </if> |
| | | <if test="companyId!=null and companyId!='' "> |
| | | and ser.company_id=#{companyId} |
| | | </if> |
| | | <if test="supplierId!=null and supplierId!='' "> |
| | | and ser.supplier_id=#{supplierId} |
| | | </if> |
| | | <if test="getDepart!=null and getDepart!='' "> |
| | | and sd.depart_name like concat('%',#{getDepart},'%') |
| | | </if> |
| | | <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> |
| | | and ser.create_time between #{strTime} and #{endTime} |
| | | </if> |
| | | order by ser.create_time desc |
| | | </select> |
| | | <select id="embedmentRecordInfo" parameterType="java.lang.String" resultType="com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity"> |
| | | select |
| | | ser.id, |
| | | ser.embedment_id as embedmentId, |
| | | ser.stock_type as stockType, |
| | | ser.change_stock as changeStock, |
| | | ser.supplier_id as supplierId, |
| | | ser.single_price as singlePrice, |
| | | ser.amount as amount, |
| | | ser.remark as remark, |
| | | ser.get_depart as getDepart, |
| | | ser.create_user as createUser, |
| | | ser.create_time as createTime, |
| | | ser.is_use as isUse, |
| | | seg.embedment_name as embedmentName, |
| | | seg.embedment_model as embedmentModel, |
| | | sd.depart_name as departName |
| | | from sys_embedment_record ser |
| | | left join sys_embedment_goods seg on ser.embedment_id=seg.id |
| | | left join sys_depart sd on sd.depart_id=ser.get_depart |
| | | where ser.is_use=1 and ser.id=#{id} |
| | | </select> |
| | | |
| | | <update id="embedmentRecordDel" > |
| | | update sys_embedment_record set |
| | | is_use=2 |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.controller; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.thhy.general.common.BasicResult; |
| | | import com.thhy.general.utils.PagingUtils; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDevice; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceAddDto; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceDto; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceListVo; |
| | | import com.thhy.mobile.modules.biz.checkdevice.service.CheckDeviceService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhang_xiao_bo |
| | | * @since 2023-09-25 16:02:35 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("checkDevice") |
| | | public class CheckDeviceController { |
| | | |
| | | |
| | | @Autowired |
| | | private CheckDeviceService checkDeviceService; |
| | | |
| | | @RequestMapping("findList") |
| | | public BasicResult findList(@RequestBody(required = false) CheckDeviceDto checkDeviceDto, HttpServletRequest req){ |
| | | PagingUtils.setPageParam(req); |
| | | List<CheckDeviceListVo> checkDeviceList = checkDeviceService.findList(checkDeviceDto); |
| | | PageInfo<CheckDeviceListVo> pageInfo = new PageInfo<>(checkDeviceList); |
| | | return BasicResult.success(pageInfo); |
| | | } |
| | | |
| | | @RequestMapping("checkDeviceInfo") |
| | | public BasicResult checkDeviceInfo(@RequestBody(required = false) CheckDeviceDto checkDeviceDto){ |
| | | CheckDeviceListVo listVo = checkDeviceService.checkDeviceInfo(checkDeviceDto); |
| | | return BasicResult.success(listVo); |
| | | } |
| | | |
| | | @RequestMapping("addCheckDevice") |
| | | public BasicResult addCheckDevice(@RequestBody CheckDeviceAddDto checkDeviceAddDto){ |
| | | checkDeviceService.addCheckDevice(checkDeviceAddDto); |
| | | return BasicResult.success(); |
| | | } |
| | | |
| | | /** |
| | | @RequestMapping("update") |
| | | public BasicResult update(@RequestBody CheckDevice checkDevice){ |
| | | checkDeviceService.update(checkDevice); |
| | | return BasicResult.success(); |
| | | }**/ |
| | | |
| | | @RequestMapping("delete") |
| | | public BasicResult delete(@RequestBody CheckDevice checkDevice){ |
| | | checkDeviceService.delete(checkDevice.getId()); |
| | | return BasicResult.success(); |
| | | } |
| | | |
| | | @RequestMapping("deviceList") |
| | | public BasicResult deviceList(){ |
| | | List<HashMap<String,Object>> hashMapList = checkDeviceService.deviceList(); |
| | | return BasicResult.success(hashMapList); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.entity; |
| | | |
| | | import com.thhy.general.annotations.Idkey; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | /** |
| | | * |
| | | * @author zhang_xiao_bo |
| | | * @since 2023-09-25 16:02:35 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class CheckDevice implements Serializable { |
| | | |
| | | |
| | | /** |
| | | * 责任人 |
| | | */ |
| | | |
| | | |
| | | private String adminUser; |
| | | |
| | | /** |
| | | * 点检内容 |
| | | */ |
| | | |
| | | |
| | | private String checkContent; |
| | | |
| | | /** |
| | | * 点检时间 |
| | | */ |
| | | |
| | | |
| | | private Date checkTime; |
| | | |
| | | /** |
| | | * 点检类型 字典表 |
| | | */ |
| | | |
| | | |
| | | private String checkType; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 设备ID |
| | | */ |
| | | |
| | | |
| | | private String deviceId; |
| | | |
| | | |
| | | @Idkey |
| | | private String id; |
| | | |
| | | |
| | | /** |
| | | * 1Y0N |
| | | */ |
| | | |
| | | |
| | | private Integer isUse; |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.entity; |
| | | |
| | | import com.thhy.general.annotations.Idkey; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CheckDeviceAddDto implements Serializable { |
| | | |
| | | /** |
| | | * 责任人 |
| | | */ |
| | | |
| | | |
| | | private String adminUser; |
| | | |
| | | /** |
| | | * 点检内容 |
| | | */ |
| | | |
| | | |
| | | private String checkContent; |
| | | |
| | | /** |
| | | * 点检时间 |
| | | */ |
| | | |
| | | |
| | | private Date checkTime; |
| | | |
| | | /** |
| | | * 点检类型 字典表 |
| | | */ |
| | | |
| | | |
| | | private String checkType; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 设备ID |
| | | */ |
| | | |
| | | |
| | | private String deviceId; |
| | | |
| | | |
| | | @Idkey |
| | | private String id; |
| | | |
| | | |
| | | /** |
| | | * 1Y0N |
| | | */ |
| | | |
| | | |
| | | private Integer isUse; |
| | | |
| | | private List<CheckDeviceFile> fileList; |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class CheckDeviceDto implements Serializable { |
| | | |
| | | private String bigDeviceName; |
| | | |
| | | private Date startTime; |
| | | |
| | | private Date endTime; |
| | | |
| | | private String id; |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.entity; |
| | | |
| | | import com.thhy.general.annotations.Idkey; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * |
| | | * @author zhang_xiao_bo |
| | | * @since 2023-09-25 16:03:58 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class CheckDeviceFile implements Serializable { |
| | | |
| | | |
| | | /** |
| | | * 点检ID |
| | | */ |
| | | |
| | | |
| | | private String checkId; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | |
| | | |
| | | private String file; |
| | | |
| | | |
| | | @Idkey |
| | | private String id; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.entity; |
| | | |
| | | import com.thhy.general.annotations.Idkey; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CheckDeviceListVo implements Serializable { |
| | | |
| | | /** |
| | | * 责任人 |
| | | */ |
| | | |
| | | |
| | | private String adminUser; |
| | | |
| | | private String adminUserName; |
| | | |
| | | private String adminUserPhone; |
| | | |
| | | /** |
| | | * 点检内容 |
| | | */ |
| | | |
| | | |
| | | private String checkContent; |
| | | |
| | | /** |
| | | * 点检时间 |
| | | */ |
| | | |
| | | |
| | | private Date checkTime; |
| | | |
| | | /** |
| | | * 点检类型 字典表 |
| | | */ |
| | | |
| | | |
| | | private String checkType; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 设备ID |
| | | */ |
| | | |
| | | |
| | | private String deviceId; |
| | | |
| | | |
| | | @Idkey |
| | | private String id; |
| | | |
| | | |
| | | /** |
| | | * 1Y0N |
| | | */ |
| | | |
| | | |
| | | private Integer isUse; |
| | | |
| | | private String bigDeviceId; |
| | | private String bigDeviceName; |
| | | private String bigDeviceModel; |
| | | private String bigNumber; |
| | | private String bigType; |
| | | private String bigTypeStr; |
| | | |
| | | private List<CheckDeviceFile> fileList; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.mapper; |
| | | |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceFile; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * @author zhang_xiao_bo |
| | | * @since 2023-09-25 16:03:58 |
| | | */ |
| | | @Component |
| | | public interface CheckDeviceFileMapper { |
| | | |
| | | |
| | | CheckDeviceFile queryById(Serializable id); |
| | | |
| | | Integer queryVersionById(Serializable id); |
| | | |
| | | List<CheckDeviceFile> findList(CheckDeviceFile checkdevicefile); |
| | | |
| | | List<CheckDeviceFile> findAll(String checkId); |
| | | |
| | | void insert(CheckDeviceFile checkdevicefile); |
| | | |
| | | void update(CheckDeviceFile checkdevicefile); |
| | | |
| | | void deletelogic(Serializable id); |
| | | |
| | | void deleteById(Serializable id); |
| | | |
| | | void deleteByCheckId(String checkId); |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.mapper; |
| | | |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDevice; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceDto; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceListVo; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * @author zhang_xiao_bo |
| | | * @since 2023-09-25 16:02:35 |
| | | */ |
| | | @Component |
| | | public interface CheckDeviceMapper { |
| | | |
| | | |
| | | CheckDevice queryById(Serializable id); |
| | | |
| | | CheckDeviceListVo queryInfoById(String id); |
| | | |
| | | Integer queryVersionById(Serializable id); |
| | | |
| | | List<CheckDeviceListVo> findList(CheckDeviceDto checkDeviceDto); |
| | | |
| | | List<CheckDevice> findAll(); |
| | | |
| | | void insert(CheckDevice checkdevice); |
| | | |
| | | void update(CheckDevice checkdevice); |
| | | |
| | | void deletelogic(Serializable id); |
| | | |
| | | void deleteById(Serializable id); |
| | | |
| | | List<HashMap<String,Object>> deviceList(String companyId); |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.service; |
| | | |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDevice; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceAddDto; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceDto; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceListVo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * @author zhang_xiao_bo |
| | | * @since 2023-09-25 16:02:35 |
| | | */ |
| | | public interface CheckDeviceService { |
| | | |
| | | CheckDevice get(Serializable id); |
| | | |
| | | List<CheckDeviceListVo> findList(CheckDeviceDto checkDeviceDto); |
| | | |
| | | CheckDeviceListVo checkDeviceInfo(CheckDeviceDto checkDeviceDto); |
| | | |
| | | void addCheckDevice(CheckDeviceAddDto checkDeviceAddDto); |
| | | |
| | | void update(CheckDevice checkDevice); |
| | | |
| | | void delete(Serializable id); |
| | | |
| | | List<HashMap<String,Object>> deviceList(); |
| | | } |
对比新文件 |
| | |
| | | package com.thhy.mobile.modules.biz.checkdevice.service.impl; |
| | | |
| | | import com.thhy.general.config.SysUserInfo; |
| | | import com.thhy.general.utils.DeepCopyUtils; |
| | | import com.thhy.general.utils.UserInfoUtils; |
| | | import com.thhy.mobile.modules.biz.checkdevice.entity.*; |
| | | import com.thhy.mobile.modules.biz.checkdevice.mapper.CheckDeviceFileMapper; |
| | | import com.thhy.mobile.modules.biz.checkdevice.mapper.CheckDeviceMapper; |
| | | import com.thhy.mobile.modules.biz.checkdevice.service.CheckDeviceService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * @author zhang_xiao_bo |
| | | * @since 2023-09-25 16:02:35 |
| | | */ |
| | | @Service |
| | | public class CheckDeviceServiceImpl implements CheckDeviceService { |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private CheckDeviceMapper checkDeviceMapper; |
| | | |
| | | @Autowired |
| | | private CheckDeviceFileMapper fileMapper; |
| | | |
| | | public CheckDevice get(Serializable id){ |
| | | return checkDeviceMapper.queryById(id); |
| | | } |
| | | |
| | | public List<CheckDeviceListVo> findList(CheckDeviceDto checkDeviceDto){ |
| | | return checkDeviceMapper.findList(checkDeviceDto); |
| | | } |
| | | |
| | | public CheckDeviceListVo checkDeviceInfo(CheckDeviceDto checkDeviceDto){ |
| | | CheckDeviceListVo deviceListVo = checkDeviceMapper.queryInfoById(checkDeviceDto.getId()); |
| | | List<CheckDeviceFile> fileList = fileMapper.findAll(deviceListVo.getId()); |
| | | deviceListVo.setFileList(fileList); |
| | | return deviceListVo; |
| | | } |
| | | |
| | | /** |
| | | * 增加和修改 |
| | | * @param checkDeviceAddDto |
| | | */ |
| | | @Transactional |
| | | public void addCheckDevice(CheckDeviceAddDto checkDeviceAddDto){ |
| | | SysUserInfo userInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | List<CheckDeviceFile> fileList = checkDeviceAddDto.getFileList(); |
| | | CheckDevice checkDevice = new CheckDevice(); |
| | | DeepCopyUtils.copy(checkDeviceAddDto,checkDevice); |
| | | if(checkDevice.getId() == null){ |
| | | //增加操作 |
| | | checkDevice.setAdminUser(userInfo.getUserId()); |
| | | checkDeviceMapper.insert(checkDevice); |
| | | }else{ |
| | | //修改操作 |
| | | checkDeviceMapper.update(checkDevice); |
| | | fileMapper.deleteByCheckId(checkDevice.getId()); |
| | | } |
| | | for(CheckDeviceFile deviceFile : fileList){ |
| | | deviceFile.setCheckId(checkDevice.getId()); |
| | | fileMapper.insert(deviceFile); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param checkDevice |
| | | */ |
| | | public void update(CheckDevice checkDevice){ |
| | | checkDeviceMapper.update(checkDevice); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | */ |
| | | public void delete(Serializable id){ |
| | | checkDeviceMapper.deletelogic(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<HashMap<String, Object>> deviceList() { |
| | | SysUserInfo userInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | return checkDeviceMapper.deviceList(userInfo.getCompanyId()); |
| | | } |
| | | } |
| | |
| | | server: |
| | | port: 8884 |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | | - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
对比新文件 |
| | |
| | | <?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.thhy.mobile.modules.biz.checkdevice.mapper.CheckDeviceFileMapper"> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | t.id as id, |
| | | t.check_id as checkId, |
| | | t.file as file |
| | | </sql> |
| | | |
| | | <sql id="condition_query"> |
| | | <where> |
| | | <trim suffixOverrides=" AND "> |
| | | <if test="checkId!=null and checkId!=''"> |
| | | t.check_id = #{checkId} AND |
| | | </if> |
| | | <if test="file!=null and file!=''"> |
| | | t.file = #{file} AND |
| | | </if> |
| | | </trim> |
| | | </where> |
| | | </sql> |
| | | |
| | | <select id="queryById" resultType="com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceFile"> |
| | | select <include refid="Base_Column_List" /> |
| | | from t_check_device_file t |
| | | where t.id=#{id} |
| | | </select> |
| | | |
| | | <select id="queryVersionById" resultType="integer"> |
| | | select version from t_check_device_file |
| | | where id=#{id} |
| | | </select> |
| | | |
| | | <!--查询列表--> |
| | | <select id="findList" resultType="com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceFile"> |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | from t_check_device_file t |
| | | <include refid="condition_query" /> |
| | | </select> |
| | | |
| | | <!--查询列表--> |
| | | <select id="findAll" resultType="com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceFile"> |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | from t_check_device_file t |
| | | where t.check_id = #{checkId} |
| | | </select> |
| | | |
| | | <!--插入操作--> |
| | | <insert id="insert"> |
| | | insert into t_check_device_file |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="checkId != null"> |
| | | check_id, |
| | | </if> |
| | | <if test="file != null"> |
| | | file, |
| | | </if> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | </trim> |
| | | |
| | | <trim prefix="values (" suffix=")" suffixOverrides="," > |
| | | <if test="checkId != null"> |
| | | #{checkId}, |
| | | </if> |
| | | <if test="file != null"> |
| | | #{file}, |
| | | </if> |
| | | <if test="id != null"> |
| | | #{id}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | |
| | | <!--更新操作--> |
| | | <update id="update"> |
| | | update t_check_device_file |
| | | <set> |
| | | <if test="checkId != null"> |
| | | check_id=#{checkId}, |
| | | </if> |
| | | <if test="file != null"> |
| | | file=#{file}, |
| | | </if> |
| | | </set> |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <!--逻辑删除--> |
| | | <update id="deletelogic"> |
| | | update t_check_device_file |
| | | SET is_use = 0 |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <!--根据ID删除--> |
| | | <delete id="deleteById"> |
| | | delete from t_check_device_file |
| | | where id=#{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteByCheckId"> |
| | | delete from t_check_device_file |
| | | where check_id=#{checkId} |
| | | </delete> |
| | | |
| | | </mapper> |
对比新文件 |
| | |
| | | <?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.thhy.mobile.modules.biz.checkdevice.mapper.CheckDeviceMapper"> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | t.id as id, |
| | | t.admin_user as adminUser, |
| | | t.check_content as checkContent, |
| | | t.check_time as checkTime, |
| | | t.check_type as checkType, |
| | | t.create_time as createTime, |
| | | t.device_id as deviceId, |
| | | t.is_use as isUse |
| | | </sql> |
| | | |
| | | <sql id="condition_query"> |
| | | <where> |
| | | <trim suffixOverrides=" AND "> |
| | | <if test="adminUser!=null and adminUser!=''"> |
| | | t.admin_user = #{adminUser} AND |
| | | </if> |
| | | <if test="checkContent!=null and checkContent!=''"> |
| | | t.check_content = #{checkContent} AND |
| | | </if> |
| | | <if test="checkTime!=null"> |
| | | t.check_time = #{checkTime} AND |
| | | </if> |
| | | <if test="checkType!=null and checkType!=''"> |
| | | t.check_type = #{checkType} AND |
| | | </if> |
| | | <if test="createTime!=null"> |
| | | t.create_time = #{createTime} AND |
| | | </if> |
| | | <if test="deviceId!=null and deviceId!=''"> |
| | | t.device_id = #{deviceId} AND |
| | | </if> |
| | | <if test="isUse!=null"> |
| | | t.is_use = #{isUse} AND |
| | | </if> |
| | | </trim> |
| | | </where> |
| | | </sql> |
| | | |
| | | <select id="queryById" resultType="com.thhy.mobile.modules.biz.checkdevice.entity.CheckDevice"> |
| | | select <include refid="Base_Column_List" /> |
| | | from t_check_device t |
| | | where t.id=#{id} |
| | | </select> |
| | | |
| | | <select id="queryInfoById" resultType="com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceListVo"> |
| | | SELECT |
| | | t.id as id, |
| | | t.admin_user as adminUser, |
| | | t.check_content as checkContent, |
| | | t.check_time as checkTime, |
| | | t.check_type as checkType, |
| | | t.create_time as createTime, |
| | | t.device_id as deviceId, |
| | | bd.big_device_name as bigDeviceName, |
| | | bd.big_device_model as bigDeviceModel, |
| | | bd.big_number as bigNumber, |
| | | bd.big_type as bigType, |
| | | sd.dict_name as bigTypeStr, |
| | | su.real_name as adminUserName, |
| | | su.telphone as adminUserPhone |
| | | from t_check_device t |
| | | left join t_big_device bd on t.device_id = bd.big_device_id |
| | | left join sys_dict sd on sd.dict_id = bd.big_type |
| | | left join sys_users su on su.user_id = t.admin_user |
| | | where t.id = #{id} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryVersionById" resultType="integer"> |
| | | select version from t_check_device |
| | | where id=#{id} |
| | | </select> |
| | | |
| | | <!--查询列表--> |
| | | <select id="findList" resultType="com.thhy.mobile.modules.biz.checkdevice.entity.CheckDeviceListVo"> |
| | | SELECT |
| | | t.id as id, |
| | | t.admin_user as adminUser, |
| | | t.check_content as checkContent, |
| | | t.check_time as checkTime, |
| | | t.check_type as checkType, |
| | | t.create_time as createTime, |
| | | t.device_id as deviceId, |
| | | bd.big_device_name as bigDeviceName, |
| | | bd.big_device_model as bigDeviceModel, |
| | | bd.big_number as bigNumber, |
| | | bd.big_type as bigType, |
| | | sd.dict_name as bigTypeStr, |
| | | su.real_name as adminUserName, |
| | | su.telphone as adminUserPhone |
| | | from t_check_device t |
| | | left join t_big_device bd on t.device_id = bd.big_device_id |
| | | left join sys_dict sd on sd.dict_id = bd.big_type |
| | | left join sys_users su on su.user_id = t.admin_user |
| | | <where> |
| | | <trim suffixOverrides=" AND "> |
| | | <if test="bigDeviceName !=null and bigDeviceName !=''"> |
| | | bd.big_device_name LIKE concat('%',#{bigDeviceName},'%') |
| | | </if> |
| | | <if test="startTime !=null"> |
| | | t.check_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null"> |
| | | t.check_time <= #{endTime} |
| | | </if> |
| | | </trim> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--查询列表--> |
| | | <select id="findAll" resultType="com.thhy.mobile.modules.biz.checkdevice.entity.CheckDevice"> |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | from t_check_device t |
| | | </select> |
| | | |
| | | <!--插入操作--> |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into t_check_device |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="adminUser != null"> |
| | | admin_user, |
| | | </if> |
| | | <if test="checkContent != null"> |
| | | check_content, |
| | | </if> |
| | | <if test="checkTime != null"> |
| | | check_time, |
| | | </if> |
| | | <if test="checkType != null"> |
| | | check_type, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="deviceId != null"> |
| | | device_id, |
| | | </if> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | is_use, |
| | | </if> |
| | | </trim> |
| | | |
| | | <trim prefix="values (" suffix=")" suffixOverrides="," > |
| | | <if test="adminUser != null"> |
| | | #{adminUser}, |
| | | </if> |
| | | <if test="checkContent != null"> |
| | | #{checkContent}, |
| | | </if> |
| | | <if test="checkTime != null"> |
| | | #{checkTime}, |
| | | </if> |
| | | <if test="checkType != null"> |
| | | #{checkType}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime}, |
| | | </if> |
| | | <if test="deviceId != null"> |
| | | #{deviceId}, |
| | | </if> |
| | | <if test="id != null"> |
| | | #{id}, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | #{isUse}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | |
| | | <!--更新操作--> |
| | | <update id="update"> |
| | | update t_check_device |
| | | <set> |
| | | <if test="adminUser != null"> |
| | | admin_user=#{adminUser}, |
| | | </if> |
| | | <if test="checkContent != null"> |
| | | check_content=#{checkContent}, |
| | | </if> |
| | | <if test="checkTime != null"> |
| | | check_time=#{checkTime}, |
| | | </if> |
| | | <if test="checkType != null"> |
| | | check_type=#{checkType}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time=#{createTime}, |
| | | </if> |
| | | <if test="deviceId != null"> |
| | | device_id=#{deviceId}, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | is_use=#{isUse}, |
| | | </if> |
| | | </set> |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <!--逻辑删除--> |
| | | <update id="deletelogic"> |
| | | update t_check_device |
| | | SET is_use = 0 |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <!--根据ID删除--> |
| | | <delete id="deleteById"> |
| | | delete from t_check_device |
| | | where id=#{id} |
| | | </delete> |
| | | |
| | | <select id="deviceList" resultType="hashmap"> |
| | | select big_device_id as bigDeviceId,big_device_name as bigDeviceName from t_big_device |
| | | where is_use = 1 and company_id = #{companyId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | | - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | |
| | | server: |
| | | port: 8886 |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | on-profile: pro |
| | | import: |
| | | - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |
| | | - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} |