Browse Source

Merge branch 'master' of http://47.100.37.243:10080/wutt/lsappBms

sunyadv 5 years ago
parent
commit
5a9789558f

+ 5 - 3
center-data/src/main/resources/application-prod.properties

@@ -15,10 +15,12 @@ spring.thymeleaf.jackson.date-format=yyyy-MM-dd HH:mm:ss
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 # 云模服务器对应的数据库
 # 云模服务器对应的数据库
 #spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 #spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+#spring.datasource.username=root
+#spring.datasource.password=p011430seya1026
 # 我们测试的自己服务器数据库
 # 我们测试的自己服务器数据库
-spring.datasource.url=jdbc:mysql://118.190.47.230:3306/geminidatabridge_yun?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-spring.datasource.username=root
-spring.datasource.password=p011430seya1026
+spring.datasource.url=jdbc:mysql://10.214.111.235:3306/geminidatabridge?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+spring.datasource.username=appUser
+spring.datasource.password=appUser
 #spring.datasource.druid.test-on-borrow=true
 #spring.datasource.druid.test-on-borrow=true
 #spring.datasource.druid.test-while-idle=true
 #spring.datasource.druid.test-while-idle=true
 # ####################################################################################################
 # ####################################################################################################

+ 8 - 5
pcbms/src/main/java/com/hssx/pcbms/controller/GoodsController.java

@@ -43,10 +43,11 @@ public class GoodsController {
      * 参数:
      * 参数:
      * userId :当前登录人的id
      * userId :当前登录人的id
      * name :名称,tagId:标签id,modelNumber:模具型号,company:公司
      * name :名称,tagId:标签id,modelNumber:模具型号,company:公司
-     * ,address:地址,factory:生产厂家,pic:产品图片文件路径,serviceLife:服务期限(天),
-     * nextIndate:下次维护日期,number:数量,deptStr:部门编号前缀,goodStr:产品编号前缀
-     * 注:产品编号=部门编号前缀+产品编号前缀+随机数
-     *
+     * ,address:地址,pic:产品图片文件路径,serviceLife:服务期限(天),
+     * nextIndate:下次维护日期,number:数量
+     * factory:供应商,
+     * projectNo:项目编号,projectName:项目名称,purchaseDate,采购日期(如:2015-12-09),warrantyPeriod:质保期限:单位(年)
+     * price:采购价格
      * @return
      * @return
      */
      */
     @ApiOperation(value = "资产录入", notes = "资产录入方法")
     @ApiOperation(value = "资产录入", notes = "资产录入方法")
@@ -84,7 +85,9 @@ public class GoodsController {
      * 资产基本信息修改
      * 资产基本信息修改
      * 参数:id:资产信息id
      * 参数:id:资产信息id
      * name :名称,tagId:标签id,modelNumber:模具型号,company:公司
      * name :名称,tagId:标签id,modelNumber:模具型号,company:公司
-     * ,address:地址,factory:生产厂家,pic:产品图片文件路径,serviceLife:服务期限(天),
+     * ,address:地址,factory:供应商,pic:产品图片文件路径,serviceLife:服务期限(天),
+     * projectNo:项目编号,projectName:项目名称,purchaseDate,采购日期(如:2015-12-09),warrantyPeriod:质保期限:单位(年)
+     * price:采购价格
      * nextIndate:下次维护日期(以上信息除了id外未修改的均不传)
      * nextIndate:下次维护日期(以上信息除了id外未修改的均不传)
      *
      *
      * @return
      * @return

+ 41 - 10
pcbms/src/main/java/com/hssx/pcbms/entity/Goods.java

@@ -1,5 +1,6 @@
 package com.hssx.pcbms.entity;
 package com.hssx.pcbms.entity;
 
 
+import java.math.BigDecimal;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -18,7 +19,7 @@ import lombok.experimental.Accessors;
  * </p>
  * </p>
  *
  *
  * @author 吴涛涛
  * @author 吴涛涛
- * @since 2019-11-14
+ * @since 2019-12-06
  */
  */
 @Data
 @Data
 @EqualsAndHashCode(callSuper = false)
 @EqualsAndHashCode(callSuper = false)
@@ -34,13 +35,13 @@ public class Goods extends Model<Goods> {
     private Integer id;
     private Integer id;
 
 
     /**
     /**
-     * 名称
+     * 名称/机柜名称/机柜设备名称
      */
      */
     @TableField("name")
     @TableField("name")
     private String name;
     private String name;
 
 
     /**
     /**
-     * 分类标签id,录入机柜时默认传-1
+     * 分类标签id
      */
      */
     @TableField("tag_id")
     @TableField("tag_id")
     private Integer tagId;
     private Integer tagId;
@@ -64,7 +65,7 @@ public class Goods extends Model<Goods> {
     private String address;
     private String address;
 
 
     /**
     /**
-     * 生产厂家
+     * 供应商
      */
      */
     @TableField("factory")
     @TableField("factory")
     private String factory;
     private String factory;
@@ -100,37 +101,37 @@ public class Goods extends Model<Goods> {
     private Integer creatorId;
     private Integer creatorId;
 
 
     /**
     /**
-     * 用于比较的部门代码
+     * 用于比较的部门代码(废弃字段)
      */
      */
     @TableField("division_code")
     @TableField("division_code")
     private String divisionCode;
     private String divisionCode;
 
 
     /**
     /**
-     * 用于比较的前缀代码
+     * 用于比较的前缀代码(废弃字段)
      */
      */
     @TableField("suffix_code")
     @TableField("suffix_code")
     private String suffixCode;
     private String suffixCode;
 
 
     /**
     /**
-     * 资产类型 0-普通资产 1-机柜
+     * 资产类型 0-普通资产 
      */
      */
     @TableField("good_type")
     @TableField("good_type")
     private Integer goodType;
     private Integer goodType;
 
 
     /**
     /**
-     * 机柜id(只用于录入,没有与其他表关联)
+     * 预留字段
      */
      */
     @TableField("rack_id")
     @TableField("rack_id")
     private String rackId;
     private String rackId;
 
 
     /**
     /**
-     * 机柜对应ip,如:192.168.0.190
+     * 预留字段
      */
      */
     @TableField("rack_ip")
     @TableField("rack_ip")
     private String rackIp;
     private String rackIp;
 
 
     /**
     /**
-     * 机柜对应端口
+     * 预留字段
      */
      */
     @TableField("rack_port")
     @TableField("rack_port")
     private String rackPort;
     private String rackPort;
@@ -142,6 +143,36 @@ public class Goods extends Model<Goods> {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime indate;
     private LocalDateTime indate;
 
 
+    /**
+     * 项目编号
+     */
+    @TableField("project_no")
+    private String projectNo;
+
+    /**
+     * 项目名称
+     */
+    @TableField("project_name")
+    private String projectName;
+
+    /**
+     * 采购日期(如:2015-12-09)
+     */
+    @TableField("purchase_date")
+    private String purchaseDate;
+
+    /**
+     * 质保期限:单位(年)
+     */
+    @TableField("warranty_period")
+    private Integer warrantyPeriod;
+
+    /**
+     * 采购价格
+     */
+    @TableField("price")
+    private BigDecimal price;
+
 
 
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {

+ 52 - 0
pcbms/src/main/java/com/hssx/pcbms/entity/GoodsPrefix.java

@@ -0,0 +1,52 @@
+package com.hssx.pcbms.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-12-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class GoodsPrefix extends Model<GoodsPrefix> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 资产前缀字母表主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 资产字母前缀(如LSZC)
+     */
+    @TableField("prefix_str")
+    private String prefixStr;
+
+    /**
+     * 录入时间
+     */
+    @TableField("indate")
+    private LocalDateTime indate;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
pcbms/src/main/java/com/hssx/pcbms/mapper/GoodsPrefixMapper.java

@@ -0,0 +1,16 @@
+package com.hssx.pcbms.mapper;
+
+import com.hssx.pcbms.entity.GoodsPrefix;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-12-06
+ */
+public interface GoodsPrefixMapper extends BaseMapper<GoodsPrefix> {
+
+}

+ 16 - 0
pcbms/src/main/java/com/hssx/pcbms/service/GoodsPrefixService.java

@@ -0,0 +1,16 @@
+package com.hssx.pcbms.service;
+
+import com.hssx.pcbms.entity.GoodsPrefix;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-12-06
+ */
+public interface GoodsPrefixService extends IService<GoodsPrefix> {
+
+}

+ 20 - 0
pcbms/src/main/java/com/hssx/pcbms/service/impl/GoodsPrefixServiceImpl.java

@@ -0,0 +1,20 @@
+package com.hssx.pcbms.service.impl;
+
+import com.hssx.pcbms.entity.GoodsPrefix;
+import com.hssx.pcbms.mapper.GoodsPrefixMapper;
+import com.hssx.pcbms.service.GoodsPrefixService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-12-06
+ */
+@Service
+public class GoodsPrefixServiceImpl extends ServiceImpl<GoodsPrefixMapper, GoodsPrefix> implements GoodsPrefixService {
+
+}

+ 55 - 47
pcbms/src/main/java/com/hssx/pcbms/service/impl/GoodsServiceImpl.java

@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
+
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
@@ -65,35 +66,41 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     private NewsNoticeUserMapper newsNoticeUserMapper;
     private NewsNoticeUserMapper newsNoticeUserMapper;
     @Resource
     @Resource
     private RacksEquipmentMapper racksEquipmentMapper;
     private RacksEquipmentMapper racksEquipmentMapper;
+    @Resource
+    private GoodsPrefixMapper goodsPrefixMapper;
 
 
     @Override
     @Override
     public HttpRespMsg add(GoodsVO goodsVO) {
     public HttpRespMsg add(GoodsVO goodsVO) {
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();
-        Integer count = goodsNoMapper.selectCount(new QueryWrapper<GoodsNo>().eq("division_code", goodsVO.getDeptStr()).eq("suffix_code", goodsVO.getGoodStr()).last("limit 1"));
-        if (count > 0) {
-            msg.setError("当前编号组合已存在,请更换编号组合后重试。");
-            return msg;
-        }
         Goods goods = new Goods();
         Goods goods = new Goods();
         BeanUtils.copyProperties(goodsVO, goods);
         BeanUtils.copyProperties(goodsVO, goods);
         List<GoodsNo> list = new ArrayList<>();
         List<GoodsNo> list = new ArrayList<>();
-        goods.setSuffixCode(goodsVO.getGoodStr());
-        goods.setDivisionCode(goodsVO.getDeptStr());
         goods.setCreatorId(goodsVO.getUserId());
         goods.setCreatorId(goodsVO.getUserId());
         goodsMapper.insert(goods);
         goodsMapper.insert(goods);
-        String mouldNo = goodsVO.getDeptStr() + "-" + goodsVO.getGoodStr();
         if (0 != goodsVO.getNumber()) {
         if (0 != goodsVO.getNumber()) {
-            for (int i = 1; i <= goodsVO.getNumber(); i++) {
-                GoodsNo goodsNo = new GoodsNo();
-                goodsNo.setGoodsId(goods.getId());
-                goodsNo.setModelNo(mouldNo + String.format("%04d", i));
-                goodsNo.setSuffixCode(goodsVO.getGoodStr());
-                goodsNo.setDivisionCode(goodsVO.getDeptStr());
-                list.add(goodsNo);
+            GoodsNo lastGoodsNo = goodsNoMapper.selectOne(new QueryWrapper<GoodsNo>().orderByDesc("id").last("limit 1"));
+            GoodsPrefix goodsPrefix = goodsPrefixMapper.selectOne(new QueryWrapper<GoodsPrefix>().orderByDesc("id").last("limit 1"));
+            if (lastGoodsNo == null) {
+                for (int i = 1; i <= goodsVO.getNumber(); i++) {
+                    GoodsNo goodsNo = new GoodsNo();
+                    goodsNo.setGoodsId(goods.getId());
+                    goodsNo.setModelNo(goodsPrefix.getPrefixStr() + String.format("%07d", i));
+                    list.add(goodsNo);
+                }
+                goodsNoService.saveBatch(list);
+            } else {
+                Integer start = Integer.parseInt(lastGoodsNo.getModelNo().substring(goodsPrefix.getPrefixStr().length()));
+                for (int i = 1; i <= goodsVO.getNumber(); i++) {
+                    GoodsNo goodsNo = new GoodsNo();
+                    goodsNo.setGoodsId(goods.getId());
+                    goodsNo.setModelNo(goodsPrefix.getPrefixStr() + String.format("%07d", start+1));
+                    list.add(goodsNo);
+                }
+                goodsNoService.saveBatch(list);
             }
             }
-            goodsNoService.saveBatch(list);
         } else {
         } else {
             msg.setError("资产数量必须大于零");
             msg.setError("资产数量必须大于零");
+            return msg;
         }
         }
         return msg;
         return msg;
     }
     }
@@ -119,7 +126,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 ////                msg.data = info;
 ////                msg.data = info;
 ////                return msg;
 ////                return msg;
 //            }else if(tagId==-2){
 //            }else if(tagId==-2){
-                //设备列表
+        //设备列表
 //                QueryWrapper<GoodsNo> qw = new QueryWrapper();
 //                QueryWrapper<GoodsNo> qw = new QueryWrapper();
 //                if(keyName!=null && !"".equals(keyName)){
 //                if(keyName!=null && !"".equals(keyName)){
 //                    qw.eq("device_name",keyName);
 //                    qw.eq("device_name",keyName);
@@ -138,19 +145,19 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 //            }
 //            }
 //        }else{
 //        }else{
         Integer goodType = 0;
         Integer goodType = 0;
-        if(tagId !=null){
-            if(tagId==-1){
+        if (tagId != null) {
+            if (tagId == -1) {
                 goodType = 1;
                 goodType = 1;
-            }else if(tagId==-2){
+            } else if (tagId == -2) {
                 goodType = 2;
                 goodType = 2;
             }
             }
         }
         }
-        if(goodType==0){
+        if (goodType == 0) {
             list = goodsMapper.getListBycondition(keyName, tagId, uid);
             list = goodsMapper.getListBycondition(keyName, tagId, uid);
             PageInfo<GoodsVO> info = new PageInfo<>(list);
             PageInfo<GoodsVO> info = new PageInfo<>(list);
             msg.data = info;
             msg.data = info;
-        }else{
-            list = goodsMapper.getRackListBycondition(keyName, tagId, uid,goodType);
+        } else {
+            list = goodsMapper.getRackListBycondition(keyName, tagId, uid, goodType);
             PageInfo<GoodsVO> info = new PageInfo<>(list);
             PageInfo<GoodsVO> info = new PageInfo<>(list);
             msg.data = info;
             msg.data = info;
         }
         }
@@ -182,18 +189,18 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     public HttpRespMsg getDetail(Integer id) {
     public HttpRespMsg getDetail(Integer id) {
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();
         Goods goods = goodsMapper.selectById(id);
         Goods goods = goodsMapper.selectById(id);
-        Map<String,Object> map = new HashMap<>();
-        if(goods.getGoodType()!=0){
+        Map<String, Object> map = new HashMap<>();
+        if (goods.getGoodType() != 0) {
             List<Integer> equipmentIds = racksEquipmentMapper.selectList(new QueryWrapper<RacksEquipment>().eq("rack_goods_id", id)).stream().map(RacksEquipment::getEquipmentGoodsId).collect(Collectors.toList());
             List<Integer> equipmentIds = racksEquipmentMapper.selectList(new QueryWrapper<RacksEquipment>().eq("rack_goods_id", id)).stream().map(RacksEquipment::getEquipmentGoodsId).collect(Collectors.toList());
-            if(equipmentIds.size()>0){
+            if (equipmentIds.size() > 0) {
                 List<GoodsVO> list = goodsMapper.getEuipmentList(equipmentIds);
                 List<GoodsVO> list = goodsMapper.getEuipmentList(equipmentIds);
-                map.put("equipments",list);
+                map.put("equipments", list);
             }
             }
             GoodsVO vo = goodsMapper.getDetail(id);
             GoodsVO vo = goodsMapper.getDetail(id);
-            map.put("rack",vo);
+            map.put("rack", vo);
             msg.data = map;
             msg.data = map;
             return msg;
             return msg;
-        }else{
+        } else {
             GoodsVO vo = goodsMapper.getDetail(id);
             GoodsVO vo = goodsMapper.getDetail(id);
             msg.data = vo;
             msg.data = vo;
             return msg;
             return msg;
@@ -213,7 +220,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         String nowState = "";
         String nowState = "";
         if (no.getState() == 0) {
         if (no.getState() == 0) {
             oldState = "未用";
             oldState = "未用";
-        } else if (no.getState() == 1){
+        } else if (no.getState() == 1) {
             oldState = "在用";
             oldState = "在用";
             User usering = userMapper.selectById(no.getUserId());
             User usering = userMapper.selectById(no.getUserId());
             oldState = oldState + ("(" + usering.getName() + "/" + usering.getPhone() + ")");
             oldState = oldState + ("(" + usering.getName() + "/" + usering.getPhone() + ")");
@@ -269,8 +276,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         GoodsNo oldGoodsNo = goodsNoMapper.selectOne(new QueryWrapper<GoodsNo>().eq("goods_id", goodsNo.getGoodsId()).orderByDesc("id").last("limit 1"));
         GoodsNo oldGoodsNo = goodsNoMapper.selectOne(new QueryWrapper<GoodsNo>().eq("goods_id", goodsNo.getGoodsId()).orderByDesc("id").last("limit 1"));
         Goods goods = goodsMapper.selectById(goodsNo.getGoodsId());
         Goods goods = goodsMapper.selectById(goodsNo.getGoodsId());
         Integer start = 0;
         Integer start = 0;
-        String prefix = goods.getDivisionCode()+"-"+goods.getSuffixCode();
-        if(goods != null){
+        String prefix = goods.getDivisionCode() + "-" + goods.getSuffixCode();
+        if (goods != null) {
             if (oldGoodsNo != null) {
             if (oldGoodsNo != null) {
                 start = Integer.parseInt(oldGoodsNo.getModelNo().substring(oldGoodsNo.getModelNo().length() - 4));
                 start = Integer.parseInt(oldGoodsNo.getModelNo().substring(oldGoodsNo.getModelNo().length() - 4));
                 List<GoodsNo> goodsNoList = new ArrayList<>();
                 List<GoodsNo> goodsNoList = new ArrayList<>();
@@ -337,14 +344,14 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         List<MaintainRecord> operateRecords = new ArrayList<>();
         List<MaintainRecord> operateRecords = new ArrayList<>();
         if (null != operateRecordVO.getIds()) {
         if (null != operateRecordVO.getIds()) {
             List<Integer> idList = ListUtil.convertIntegerIdsArrayToList(operateRecordVO.getIds());
             List<Integer> idList = ListUtil.convertIntegerIdsArrayToList(operateRecordVO.getIds());
-            if(idList.size()>0){
+            if (idList.size() > 0) {
                 List<GoodsNo> goodsNo = goodsNoMapper.selectList(new QueryWrapper<GoodsNo>().in("id", idList));
                 List<GoodsNo> goodsNo = goodsNoMapper.selectList(new QueryWrapper<GoodsNo>().in("id", idList));
                 for (Integer id : idList) {
                 for (Integer id : idList) {
                     MaintainRecord operateRecord = new MaintainRecord();
                     MaintainRecord operateRecord = new MaintainRecord();
                     BeanUtils.copyProperties(operateRecordVO, operateRecord);
                     BeanUtils.copyProperties(operateRecordVO, operateRecord);
                     operateRecord.setGoodsNoId(id);
                     operateRecord.setGoodsNoId(id);
                     for (GoodsNo no : goodsNo) {
                     for (GoodsNo no : goodsNo) {
-                        if(id.equals(no.getId())){
+                        if (id.equals(no.getId())) {
                             operateRecord.setModelNo(no.getModelNo());
                             operateRecord.setModelNo(no.getModelNo());
                         }
                         }
                     }
                     }
@@ -422,7 +429,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
             list.add(rowList);
             list.add(rowList);
         }
         }
         Goods newGoods = goodsMapper.selectById(goods.getId());
         Goods newGoods = goodsMapper.selectById(goods.getId());
-        String fileUrl = ExcelUtil.exportGeneralExcelByTitleAndList(response, newGoods.getName()+dateSdf2.format(new Date()), list, path);
+        String fileUrl = ExcelUtil.exportGeneralExcelByTitleAndList(response, newGoods.getName() + dateSdf2.format(new Date()), list, path);
         msg.data = fileUrl;
         msg.data = fileUrl;
         return msg;
         return msg;
     }
     }
@@ -460,13 +467,13 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
             list.add(rowList);
             list.add(rowList);
         }
         }
         Goods newGoods = goodsMapper.selectById(goods.getId());
         Goods newGoods = goodsMapper.selectById(goods.getId());
-        String fileUrl = ExcelUtil.exportGeneralExcelByTitleAndList(response, newGoods.getName()+dateSdf2.format(new Date()), list, path);
+        String fileUrl = ExcelUtil.exportGeneralExcelByTitleAndList(response, newGoods.getName() + dateSdf2.format(new Date()), list, path);
         msg.data = fileUrl;
         msg.data = fileUrl;
         return msg;
         return msg;
     }
     }
 
 
     @Override
     @Override
-    public HttpRespMsg listExcel(PageUtil page, String keyName, Integer tagId, Integer uid,HttpServletResponse response) {
+    public HttpRespMsg listExcel(PageUtil page, String keyName, Integer tagId, Integer uid, HttpServletResponse response) {
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();
         List<List<String>> list = new ArrayList<List<String>>();
         List<List<String>> list = new ArrayList<List<String>>();
         //标题
         //标题
@@ -487,21 +494,21 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
             rowList.add(dynamic.getName());
             rowList.add(dynamic.getName());
             //所属分类
             //所属分类
             for (GoodsTags goodsTag : goodsTags) {
             for (GoodsTags goodsTag : goodsTags) {
-                if(dynamic.getTagId().equals(goodsTag.getId())){
+                if (dynamic.getTagId().equals(goodsTag.getId())) {
                     rowList.add(goodsTag.getName());
                     rowList.add(goodsTag.getName());
                 }
                 }
             }
             }
             //型号
             //型号
             rowList.add(dynamic.getModelNumber());
             rowList.add(dynamic.getModelNumber());
             //数量
             //数量
-            rowList.add(dynamic.getGoodsNosVO().size()+"");
+            rowList.add(dynamic.getGoodsNosVO().size() + "");
             //单位
             //单位
             rowList.add(dynamic.getUnit());
             rowList.add(dynamic.getUnit());
             //生产厂家
             //生产厂家
             rowList.add(dynamic.getFactory());
             rowList.add(dynamic.getFactory());
             list.add(rowList);
             list.add(rowList);
         }
         }
-        String fileUrl = ExcelUtil.exportGeneralExcelByTitleAndList(response, "资产"+dateSdf2.format(new Date()), list, path);
+        String fileUrl = ExcelUtil.exportGeneralExcelByTitleAndList(response, "资产" + dateSdf2.format(new Date()), list, path);
         msg.data = fileUrl;
         msg.data = fileUrl;
         return msg;
         return msg;
     }
     }
@@ -514,7 +521,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         List<GoodsVO> goodsLists = goodsMapper.getListBycondition(null, null, null);
         List<GoodsVO> goodsLists = goodsMapper.getListBycondition(null, null, null);
         String nowDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDate.now());
         String nowDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDate.now());
         for (GoodsVO good : goodsLists) {
         for (GoodsVO good : goodsLists) {
-            if(nowDate.equals(good.getNextIndate())){
+            if (nowDate.equals(good.getNextIndate())) {
                 GoodsNo no = new GoodsNo();
                 GoodsNo no = new GoodsNo();
                 no.setGoodsId(good.getId());
                 no.setGoodsId(good.getId());
                 no.setIsMaintain(1);
                 no.setIsMaintain(1);
@@ -526,7 +533,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                 newsNotice.setRefId(good.getId());
                 newsNotice.setRefId(good.getId());
                 newsNotice.setRafName(good.getName());
                 newsNotice.setRafName(good.getName());
                 String content = Constant.GOODS_MATAIN_CONTENT;
                 String content = Constant.GOODS_MATAIN_CONTENT;
-                content = content.replace("name",good.getName()).replace("num",good.getGoodsNos().size()+good.getUnit());
+                content = content.replace("name", good.getName()).replace("num", good.getGoodsNos().size() + good.getUnit());
                 newsNotice.setContent(content);
                 newsNotice.setContent(content);
                 newsNoticeMapper.insert(newsNotice);
                 newsNoticeMapper.insert(newsNotice);
                 List<User> users = userMapper.selectOperateUsersListByCondition();
                 List<User> users = userMapper.selectOperateUsersListByCondition();
@@ -549,13 +556,14 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 //        System.out.println("QWE-ASDF0001".substring("QWE-ASDF0001".length() - 4));
 //        System.out.println("QWE-ASDF0001".substring("QWE-ASDF0001".length() - 4));
 //        System.out.println(Integer.parseInt("0001"));
 //        System.out.println(Integer.parseInt("0001"));
         List<Integer> list = new ArrayList<>();
         List<Integer> list = new ArrayList<>();
-        System.out.println(list.stream().map(a ->a).collect(Collectors.toList()));
+        System.out.println(list.stream().map(a -> a).collect(Collectors.toList()));
         String proId = "1111111";
         String proId = "1111111";
-        String sql = "select DESCS DESCS3 ADUITDATE ADUITDATE3 from t_pilot_flowaduit where proid='"+proId+"' and processinstanceid =(select processinstanceid from t_dtjms_start_report  where pro_id='"+proId+"')  and workitemname='开工报告建设审核'";
-        sql = "select DESCS DESCS2,ADUITDATE ADUITDATE2 from t_pilot_flowaduit where proid='"+proId+"' and processinstanceid =(select processinstanceid from t_dtjms_start_command  where pro_id='"+proId+"') and workitemname='建设负责人审核'";        System.out.println(sql);
+        String sql = "select DESCS DESCS3 ADUITDATE ADUITDATE3 from t_pilot_flowaduit where proid='" + proId + "' and processinstanceid =(select processinstanceid from t_dtjms_start_report  where pro_id='" + proId + "')  and workitemname='开工报告建设审核'";
+        sql = "select DESCS DESCS2,ADUITDATE ADUITDATE2 from t_pilot_flowaduit where proid='" + proId + "' and processinstanceid =(select processinstanceid from t_dtjms_start_command  where pro_id='" + proId + "') and workitemname='建设负责人审核'";
+        System.out.println(sql);
         sql = "select UPLOAD_PATH from t_dtjms_upload_document where gx_id in("
         sql = "select UPLOAD_PATH from t_dtjms_upload_document where gx_id in("
-                +"select gx_id from t_dtjms_build_log where pro_id='"
-                +proId+"') and type=30 and Upload_Time >= '"+15+" 00:00:00"+"' and UploadTime <='"+15+" 23:59:59"+"'";
+                + "select gx_id from t_dtjms_build_log where pro_id='"
+                + proId + "') and type=30 and Upload_Time >= '" + 15 + " 00:00:00" + "' and UploadTime <='" + 15 + " 23:59:59" + "'";
         System.out.println(sql);
         System.out.println(sql);
     }
     }
 }
 }

+ 1 - 1
pcbms/src/main/java/com/hssx/pcbms/util/CodeGenerator.java

@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("goods_no");
+        strategy.setInclude("goods_prefix");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);
         strategy.setControllerMappingHyphenStyle(true);

+ 5 - 5
pcbms/src/main/resources/application-prod.properties

@@ -16,12 +16,12 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 # 云模服务器对应的数据库
 # 云模服务器对应的数据库
 #spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 #spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 # 我们测试的自己服务器数据库
 # 我们测试的自己服务器数据库
-spring.datasource.url=jdbc:mysql://118.190.47.230:3306/lishui_app?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+#spring.datasource.url=jdbc:mysql://118.190.47.230:3306/lishui_app?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+#spring.datasource.username=root
+#spring.datasource.password=p011430seya1026
+spring.datasource.url=jdbc:mysql://localhost:3306/lishui_app?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 spring.datasource.username=root
 spring.datasource.username=root
-spring.datasource.password=p011430seya1026
-#spring.datasource.url=jdbc:mysql://10.214.111.235:3306/lishui_app?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-#spring.datasource.username=appuser
-#spring.datasource.password=appuser
+spring.datasource.password=Ls123456
 #spring.datasource.druid.test-on-borrow=true
 #spring.datasource.druid.test-on-borrow=true
 #spring.datasource.druid.test-while-idle=true
 #spring.datasource.druid.test-while-idle=true
 # ####################################################################################################
 # ####################################################################################################

+ 229 - 229
pcbms/src/main/resources/mapper/GoodsMapper.xml

@@ -23,82 +23,152 @@
         <result column="rack_ip" property="rackIp" />
         <result column="rack_ip" property="rackIp" />
         <result column="rack_port" property="rackPort" />
         <result column="rack_port" property="rackPort" />
         <result column="indate" property="indate" />
         <result column="indate" property="indate" />
+        <result column="project_no" property="projectNo" />
+        <result column="project_name" property="projectName" />
+        <result column="purchase_date" property="purchaseDate" />
+        <result column="warranty_period" property="warrantyPeriod" />
+        <result column="price" property="price" />
     </resultMap>
     </resultMap>
 
 
     <!-- 通用查询结果列 -->
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
-        id, name, tag_id, model_number, unit, address, factory, pic, service_life, next_indate, is_delete, creator_id, division_code, suffix_code, good_type,rack_ip, rack_port, indate
+        id, name, tag_id, model_number, unit, address, factory, pic, service_life, next_indate, is_delete, creator_id, division_code, suffix_code, good_type, rack_id, rack_ip, rack_port, indate, project_no, project_name, purchase_date, warranty_period, price
     </sql>
     </sql>
-    <resultMap id="BaseResultMapVO" type="com.hssx.pcbms.entity.vo.GoodsVO">
-        <id column="id" property="id"/>
-        <result column="name" property="name"/>
-        <result column="temp" property="temp"/>
-        <result column="hum" property="hum"/>
-        <result column="door_status" property="doorStatus"/>
-        <result column="tag_id" property="tagId"/>
-        <result column="model_number" property="modelNumber"/>
-        <result column="unit" property="unit"/>
-        <result column="address" property="address"/>
-        <result column="factory" property="factory"/>
-        <result column="pic" property="pic"/>
-        <result column="service_life" property="serviceLife"/>
-        <result column="next_indate" property="nextIndate"/>
-        <collection property="goodsNosVO" select="selectGoodsNoByGoodsId" javaType="java.util.List" column="{goodId = id}"
-                    ofType="com.hssx.pcbms.entity.vo.GoodsNoVO">
-        </collection>
-    </resultMap>
-    <!-- 我的资产查询映射结果 -->
-    <resultMap id="BaseResultMapMyList" type="com.hssx.pcbms.entity.vo.GoodsVO">
-        <id column="id" property="id"/>
-        <result column="name" property="name"/>
-        <result column="tag_id" property="tagId"/>
-        <result column="model_number" property="modelNumber"/>
-        <result column="unit" property="unit"/>
-        <result column="address" property="address"/>
-        <result column="factory" property="factory"/>
-        <result column="pic" property="pic"/>
-        <result column="service_life" property="serviceLife"/>
-        <result column="next_indate" property="nextIndate"/>
-        <result column="divisioncode" property="divisionCode"/>
-        <result column="suffixcode" property="suffixCode"/>
-        <collection property="goodsNos" ofType="com.hssx.pcbms.entity.GoodsNo">
-            <id column="nid" property="id"/>
-            <result column="model_no" property="modelNo"/>
-            <result column="division_code" property="divisionCode"/>
-            <result column="suffix_code" property="suffixCode"/>
-            <result column="state" property="state"/>
-            <result column="indate" property="indate"/>
-            <result column="goods_id" property="goodsId"/>
-            <result column="user_id" property="userId"/>
-            <result column="is_maintain" property="isMaintain" />
-        </collection>
-    </resultMap>
 
 
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMapDetail" type="com.hssx.pcbms.entity.vo.GoodsVO">
-        <id column="id" property="id"/>
-        <result column="name" property="name"/>
-        <result column="temp" property="temp"/>
-        <result column="hum" property="hum"/>
-        <result column="door_status" property="doorStatus"/>
-        <result column="tag_id" property="tagId"/>
-        <result column="model_number" property="modelNumber"/>
-        <result column="unit" property="unit"/>
-        <result column="address" property="address"/>
-        <result column="factory" property="factory"/>
-        <result column="pic" property="pic"/>
-        <result column="service_life" property="serviceLife"/>
-        <result column="next_indate" property="nextIndate"/>
-        <result column="divisioncode" property="divisionCode"/>
-        <result column="suffixcode" property="suffixCode"/>
-        <result column="good_type" property="goodType" />
-        <result column="rack_id" property="rackId" />
-        <result column="tag_name" property="tagName" />
-        <collection property="goodsNosVO" ofType="com.hssx.pcbms.entity.vo.GoodsNoVO">
-            <id column="nid" property="id"/>
+        <resultMap id="BaseResultMapVO" type="com.hssx.pcbms.entity.vo.GoodsVO">
+            <id column="id" property="id"/>
+            <result column="name" property="name"/>
+            <result column="temp" property="temp"/>
+            <result column="hum" property="hum"/>
+            <result column="door_status" property="doorStatus"/>
+            <result column="tag_id" property="tagId"/>
+            <result column="model_number" property="modelNumber"/>
+            <result column="unit" property="unit"/>
+            <result column="address" property="address"/>
+            <result column="factory" property="factory"/>
+            <result column="pic" property="pic"/>
+            <result column="service_life" property="serviceLife"/>
+            <result column="next_indate" property="nextIndate"/>
+            <collection property="goodsNos" select="selectGoodsNoByGoodsId" javaType="java.util.List" column="{goodId = id}"
+                        ofType="com.hssx.pcbms.entity.GoodsNo">
+            </collection>
+        </resultMap>
+        <!-- 我的资产查询映射结果 -->
+        <resultMap id="BaseResultMapMyList" type="com.hssx.pcbms.entity.vo.GoodsVO">
+            <id column="id" property="id"/>
+            <result column="name" property="name"/>
+            <result column="tag_id" property="tagId"/>
+            <result column="model_number" property="modelNumber"/>
+            <result column="unit" property="unit"/>
+            <result column="address" property="address"/>
+            <result column="factory" property="factory"/>
+            <result column="pic" property="pic"/>
+            <result column="service_life" property="serviceLife"/>
+            <result column="next_indate" property="nextIndate"/>
+            <result column="divisioncode" property="divisionCode"/>
+            <result column="suffixcode" property="suffixCode"/>
+            <collection property="goodsNos" ofType="com.hssx.pcbms.entity.GoodsNo">
+                <id column="nid" property="id"/>
+                <result column="model_no" property="modelNo"/>
+                <result column="division_code" property="divisionCode"/>
+                <result column="suffix_code" property="suffixCode"/>
+                <result column="state" property="state"/>
+                <result column="indate" property="indate"/>
+                <result column="goods_id" property="goodsId"/>
+                <result column="user_id" property="userId"/>
+                <result column="is_maintain" property="isMaintain" />
+            </collection>
+        </resultMap>
+
+        <!-- 通用查询映射结果 -->
+        <resultMap id="BaseResultMapDetail" type="com.hssx.pcbms.entity.vo.GoodsVO">
+            <id column="id" property="id"/>
+            <result column="name" property="name"/>
+            <result column="temp" property="temp"/>
+            <result column="hum" property="hum"/>
+            <result column="door_status" property="doorStatus"/>
+            <result column="tag_id" property="tagId"/>
+            <result column="model_number" property="modelNumber"/>
+            <result column="unit" property="unit"/>
+            <result column="address" property="address"/>
+            <result column="factory" property="factory"/>
+            <result column="pic" property="pic"/>
+            <result column="service_life" property="serviceLife"/>
+            <result column="next_indate" property="nextIndate"/>
+            <result column="divisioncode" property="divisionCode"/>
+            <result column="suffixcode" property="suffixCode"/>
+            <result column="good_type" property="goodType" />
+            <result column="rack_id" property="rackId" />
+            <result column="tag_name" property="tagName" />
+            <collection property="goodsNosVO" ofType="com.hssx.pcbms.entity.vo.GoodsNoVO">
+                <id column="nid" property="id"/>
+                <result column="model_no" property="modelNo" />
+                <result column="division_code" property="divisionCode" />
+                <result column="suffix_code" property="suffixCode" />
+                <result column="state" property="state" />
+                <result column="indate" property="indate" />
+                <result column="goods_id" property="goodsId" />
+                <result column="user_id" property="userId" />
+                <result column="update_indate" property="updateIndate" />
+                <result column="is_maintain" property="isMaintain" />
+                <result column="good_sn_no" property="goodSnNo" />
+                <result column="label_id" property="labelId" />
+                <result column="model_id" property="modelId" />
+                <result column="u_bit_num" property="uBitNum" />
+                <result column="power" property="power" />
+                <result column="rated_current" property="ratedCurrent" />
+                <result column="rated_voltage" property="ratedVoltage" />
+                <result column="serial_number" property="serialNumber" />
+                <result column="affiliate" property="affiliate" />
+                <result column="device_category" property="deviceCategory" />
+                <result column="stock" property="stock" />
+                <result column="server_weight" property="serverWeight" />
+                <result column="manufacturer" property="manufacturer" />
+                <result column="supplier" property="supplier" />
+                <result column="charger_id" property="chargerId" />
+                <result column="charger_name" property="chargerName" />
+                <result column="maintain_clc" property="maintainClc" />
+                <result column="maintenance_phone" property="maintenancePhone" />
+                <result column="last_maintainer_id" property="lastMaintainerId" />
+                <result column="last_maintainer_name" property="lastMaintainerName" />
+                <result column="next_maintainer_id" property="nextMaintainerId" />
+                <result column="next_maintainer_name" property="nextMaintainerName" />
+                <result column="last_update_time" property="lastUpdateTime" />
+                <result column="next_update_time" property="nextUpdateTime" />
+                <result column="grounding_time" property="groundingTime" />
+                <result column="undercarriage_time" property="undercarriageTime" />
+                <result column="first_use_time" property="firstUseTime" />
+                <result column="current_state" property="currentState" />
+                <result column="alarm_level" property="alarmLevel" />
+                <result column="subordinate_user_id" property="subordinateUserId" />
+                <result column="subordinate_user" property="subordinateUser" />
+                <result column="floor" property="floor" />
+                <result column="room" property="room" />
+                <result column="column_place" property="columnPlace" />
+                <result column="region" property="region" />
+                <result column="is_rack" property="isRack" />
+            </collection>
+        </resultMap>
+        <select id="getListBycondition" resultMap="BaseResultMapVO">
+            select
+            id, name, tag_id, model_number, unit, address,
+            factory, pic, service_life, next_indate
+            from
+            goods
+            <where>
+                is_delete = 0 and good_type = 0
+                <if test="keyName != null and keyName != ''">
+                    and name like concat('%',#{keyName},'%')
+                </if>
+                <if test="tagId != null">
+                    and tag_id = #{tagId}
+                </if>
+            </where>
+            order by id desc
+        </select>
+        <resultMap id="GoodsNoMap" type="com.hssx.pcbms.entity.GoodsNo">
+            <id column="id" property="id" />
             <result column="model_no" property="modelNo" />
             <result column="model_no" property="modelNo" />
-            <result column="username" property="username" />
-            <result column="phone" property="phone" />
             <result column="division_code" property="divisionCode" />
             <result column="division_code" property="divisionCode" />
             <result column="suffix_code" property="suffixCode" />
             <result column="suffix_code" property="suffixCode" />
             <result column="state" property="state" />
             <result column="state" property="state" />
@@ -143,171 +213,101 @@
             <result column="column_place" property="columnPlace" />
             <result column="column_place" property="columnPlace" />
             <result column="region" property="region" />
             <result column="region" property="region" />
             <result column="is_rack" property="isRack" />
             <result column="is_rack" property="isRack" />
-        </collection>
-    </resultMap>
-    <select id="getListBycondition" resultMap="BaseResultMapVO">
-        select
-        id, name, tag_id, model_number, unit, address,
-        factory, pic, service_life, next_indate
-        from
-        goods
-        <where>
-            is_delete = 0 and good_type = 0
-            <if test="keyName != null and keyName != ''">
-                and name like concat('%',#{keyName},'%')
-            </if>
-            <if test="tagId != null">
-                and tag_id = #{tagId}
-            </if>
-        </where>
-        order by id desc
-    </select>
-    <resultMap id="GoodsNoMap" type="com.hssx.pcbms.entity.vo.GoodsNoVO">
-        <id column="nid" property="id"/>
-        <result column="model_no" property="modelNo" />
-        <result column="division_code" property="divisionCode" />
-        <result column="suffix_code" property="suffixCode" />
-        <result column="state" property="state" />
-        <result column="indate" property="indate" />
-        <result column="goods_id" property="goodsId" />
-        <result column="user_id" property="userId" />
-        <result column="update_indate" property="updateIndate" />
-        <result column="is_maintain" property="isMaintain" />
-        <result column="good_sn_no" property="goodSnNo" />
-        <result column="label_id" property="labelId" />
-        <result column="model_id" property="modelId" />
-        <result column="u_bit_num" property="uBitNum" />
-        <result column="power" property="power" />
-        <result column="rated_current" property="ratedCurrent" />
-        <result column="rated_voltage" property="ratedVoltage" />
-        <result column="serial_number" property="serialNumber" />
-        <result column="affiliate" property="affiliate" />
-        <result column="device_category" property="deviceCategory" />
-        <result column="stock" property="stock" />
-        <result column="server_weight" property="serverWeight" />
-        <result column="manufacturer" property="manufacturer" />
-        <result column="supplier" property="supplier" />
-        <result column="charger_id" property="chargerId" />
-        <result column="charger_name" property="chargerName" />
-        <result column="maintain_clc" property="maintainClc" />
-        <result column="maintenance_phone" property="maintenancePhone" />
-        <result column="last_maintainer_id" property="lastMaintainerId" />
-        <result column="last_maintainer_name" property="lastMaintainerName" />
-        <result column="next_maintainer_id" property="nextMaintainerId" />
-        <result column="next_maintainer_name" property="nextMaintainerName" />
-        <result column="last_update_time" property="lastUpdateTime" />
-        <result column="next_update_time" property="nextUpdateTime" />
-        <result column="grounding_time" property="groundingTime" />
-        <result column="undercarriage_time" property="undercarriageTime" />
-        <result column="first_use_time" property="firstUseTime" />
-        <result column="current_state" property="currentState" />
-        <result column="alarm_level" property="alarmLevel" />
-        <result column="subordinate_user_id" property="subordinateUserId" />
-        <result column="subordinate_user" property="subordinateUser" />
-        <result column="floor" property="floor" />
-        <result column="room" property="room" />
-        <result column="column_place" property="columnPlace" />
-        <result column="region" property="region" />
-        <result column="is_rack" property="isRack" />
-        <result column="username" property="username" />
-        <result column="phone" property="phone" />
-    </resultMap>
-    <select id="selectGoodsNoByGoodsId" resultMap="GoodsNoMap">
+        </resultMap>
+        <select id="selectGoodsNoByGoodsId" resultMap="GoodsNoMap">
         select
         select
-            gn.id, gn.model_no, gn.state,gn.indate, gn.goods_id,gn.user_id, gn.update_indate,
-            gn.is_maintain, gn.good_sn_no,gn.user_id,u.name username,gn.is_maintain,u.phone,
-            gn.label_id,gn.model_id, gn.u_bit_num, gn.current_state, gn.alarm_level,gn.is_rack
+            id, model_no, state,indate, goods_id,user_id, update_indate,
+            is_maintain, good_sn_no,
+            label_id,model_id, u_bit_num, current_state, alarm_level,is_rack
         from
         from
-        goods_no gn
-        left join user u
-        on u.id = gn.user_id
+            goods_no
         where
         where
             goods_id = #{goodId}
             goods_id = #{goodId}
     </select>
     </select>
-    <select id="getDetail" resultMap="BaseResultMapDetail">
-        select
-        g.id, g.name, g.tag_id,gt.name tag_name, g.model_number, g.unit,g.address, g.factory, g.pic, g.service_life, g.next_indate,g.division_code divisioncode,g.suffix_code suffixcode,
-        g.is_delete,gn.id nid,g.good_type,rd.hum,rd.door_status,rd.temp,
-        gn.model_no, gn.division_code, gn.suffix_code, gn.state, gn.indate, gn.goods_id, gn.user_id,u.name username,gn.is_maintain,u.phone
-        from
-        goods g
-        left join
-        goods_no gn
-        on g.id = gn.goods_id
-        left join user u
-        on u.id = gn.user_id
-        left join rack_data rd
-        on g.id = rd.goods_id
-        left join goods_tags gt
-        on gt.id = g.tag_id
-        <where>
-            g.id = #{id}
-        </where>
-    </select>
-    <select id="getEuipmentList" resultMap="BaseResultMapDetail">
-        select
-        g.id, g.name, g.tag_id,gt.name tag_name, g.model_number, g.unit,g.address, g.factory, g.pic, g.service_life, g.next_indate,g.division_code divisioncode,g.suffix_code suffixcode,
-        g.is_delete,gn.id nid,g.good_type,rd.hum,rd.door_status,rd.temp,gn.is_rack,
-        gn.model_no, gn.division_code, gn.suffix_code, gn.state, gn.indate, gn.goods_id, gn.user_id,u.name username,gn.is_maintain,u.phone
-        from
-        goods g
-        left join
-        goods_no gn
-        on g.id = gn.goods_id
-        left join user u
-        on u.id = gn.user_id
-        left join rack_data rd
-        on g.id = rd.goods_id
-        left join goods_tags gt
-        on gt.id = g.tag_id
-        <where>
-            g.id in <foreach collection="ids" index="index" open="(" item="item" close=")" separator=",">
-            #{item}
-        </foreach>
-        </where>
-    </select>
-
-    <select id="selectMyList" resultMap="BaseResultMapMyList">
-        select
-        g.id, g.name, g.tag_id, g.model_number, g.unit,g.address,
-        g.factory, g.pic, g.service_life, g.next_indate,g.division_code divisioncode,
-        g.suffix_code suffixcode,g.is_delete,gn.id nid,g.indate,gn.model_no,
-        gn.division_code, gn.suffix_code, gn.state, gn.indate, gn.goods_id,
-        gn.user_id,u.name username,gn.is_maintain,u.phone
-        from
-        goods g
-        left join
-        goods_no gn
-        on g.id = gn.goods_id
-        left join user u
-        on u.id = gn.user_id
-        <where>
-            AND gn.user_id = #{uid,jdbcType=INTEGER}
-        </where>
-        order by g.indate desc
-        <if test="start != null and pageSize != null">
-            limit #{start,jdbcType=INTEGER} ,#{pageSize,jdbcType=INTEGER}
-        </if>
-    </select>
+        <select id="getDetail" resultMap="BaseResultMapDetail">
+            select
+            g.id, g.name, g.tag_id,gt.name tag_name, g.model_number, g.unit,g.address, g.factory, g.pic, g.service_life, g.next_indate,g.division_code divisioncode,g.suffix_code suffixcode,
+            g.is_delete,gn.id nid,g.good_type,rd.hum,rd.door_status,rd.temp,
+            gn.model_no, gn.division_code, gn.suffix_code, gn.state, gn.indate, gn.goods_id, gn.user_id,u.name username,gn.is_maintain,u.phone
+            from
+            goods g
+            left join
+            goods_no gn
+            on g.id = gn.goods_id
+            left join user u
+            on u.id = gn.user_id
+            left join rack_data rd
+            on g.id = rd.goods_id
+            left join goods_tags gt
+            on gt.id = g.tag_id
+            <where>
+                g.id = #{id}
+            </where>
+        </select>
+        <select id="getEuipmentList" resultMap="BaseResultMapDetail">
+            select
+            g.id, g.name, g.tag_id,gt.name tag_name, g.model_number, g.unit,g.address, g.factory, g.pic, g.service_life, g.next_indate,g.division_code divisioncode,g.suffix_code suffixcode,
+            g.is_delete,gn.id nid,g.good_type,rd.hum,rd.door_status,rd.temp,gn.is_rack,
+            gn.model_no, gn.division_code, gn.suffix_code, gn.state, gn.indate, gn.goods_id, gn.user_id,u.name username,gn.is_maintain,u.phone
+            from
+            goods g
+            left join
+            goods_no gn
+            on g.id = gn.goods_id
+            left join user u
+            on u.id = gn.user_id
+            left join rack_data rd
+            on g.id = rd.goods_id
+            left join goods_tags gt
+            on gt.id = g.tag_id
+            <where>
+                g.id in <foreach collection="ids" index="index" open="(" item="item" close=")" separator=",">
+                #{item}
+            </foreach>
+            </where>
+        </select>
 
 
-    <select id="getRackListBycondition" resultMap="BaseResultMapVO">
-        select
-        g.id, g.name, g.tag_id,rd.hum,rd.door_status,rd.temp,g.indate,
-        g.model_number, g.unit, g.address, g.factory, g.pic,
-        g.service_life, g.next_indate
-        from
-        goods g
-        left join rack_data rd
-        on g.id = rd.goods_id
-        <where>
-            is_delete = 0 and good_type = #{goodType}
-            <if test="keyName != null and keyName != ''">
-                and g.name like concat('%',#{keyName},'%')
-            </if>
-            <if test="tagId != null">
-                and g.tag_id = #{tagId}
+        <select id="selectMyList" resultMap="BaseResultMapMyList">
+            select
+            g.id, g.name, g.tag_id, g.model_number, g.unit,g.address,
+            g.factory, g.pic, g.service_life, g.next_indate,g.division_code divisioncode,
+            g.suffix_code suffixcode,g.is_delete,gn.id nid,g.indate,gn.model_no,
+            gn.division_code, gn.suffix_code, gn.state, gn.indate, gn.goods_id,
+            gn.user_id,u.name username,gn.is_maintain,u.phone
+            from
+            goods g
+            left join
+            goods_no gn
+            on g.id = gn.goods_id
+            left join user u
+            on u.id = gn.user_id
+            <where>
+                AND gn.user_id = #{uid,jdbcType=INTEGER}
+            </where>
+            order by g.indate desc
+            <if test="start != null and pageSize != null">
+                limit #{start,jdbcType=INTEGER} ,#{pageSize,jdbcType=INTEGER}
             </if>
             </if>
-        </where>
-        order by g.indate desc
-    </select>
+        </select>
+
+        <select id="getRackListBycondition" resultMap="BaseResultMapVO">
+            select
+            g.id, g.name, g.tag_id,rd.hum,rd.door_status,rd.temp,g.indate,
+            g.model_number, g.unit, g.address, g.factory, g.pic,
+            g.service_life, g.next_indate
+            from
+            goods g
+            left join rack_data rd
+            on g.id = rd.goods_id
+            <where>
+                is_delete = 0 and good_type = #{goodType}
+                <if test="keyName != null and keyName != ''">
+                    and g.name like concat('%',#{keyName},'%')
+                </if>
+                <if test="tagId != null">
+                    and g.tag_id = #{tagId}
+                </if>
+            </where>
+            order by g.indate desc
+        </select>
 </mapper>
 </mapper>

+ 17 - 0
pcbms/src/main/resources/mapper/GoodsPrefixMapper.xml

@@ -0,0 +1,17 @@
+<?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.hssx.pcbms.mapper.GoodsPrefixMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.pcbms.entity.GoodsPrefix">
+        <id column="id" property="id" />
+        <result column="prefix_str" property="prefixStr" />
+        <result column="indate" property="indate" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, prefix_str, indate
+    </sql>
+
+</mapper>