瀏覽代碼

新增移除4库取消移入

JiangPengLi 3 月之前
父節點
當前提交
9f957595ad

+ 2 - 1
projects-service/src/main/java/com/rtrh/projects/modules/projects/enums/SubInfoStatusEnum.java

@@ -17,7 +17,8 @@ public enum SubInfoStatusEnum {
     CB("1", "储备"),
     XJ("2", "新建"),
     ZJ("3", "在建"),
-    TC("9", "投产");
+    TC("9", "投产"),
+    REMOVE("5", "移除项目");
 
     private final String code;
     private final String desc;

+ 2 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/JUnitMapper.java

@@ -18,4 +18,6 @@ public interface JUnitMapper {
     List<Map<String, Object>> getListByIdStatusOne(@Param("unitPropId") String unitPropId, @Param("unitKindId") String unitKindId, @Param("title") String title, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("status") String status);
 
     List<Map<String, Object>> getListByIdOtherStatus(@Param("id") String id, @Param("unitPropId") String unitPropId, @Param("unitKindId") String unitKindId, @Param("title") String title, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("status") String status);
+
+    List<JUnit> getUnitByKind(@Param("code") String code);
 }

+ 69 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/JUnitMapper.xml

@@ -161,5 +161,74 @@
             </if>
         </where>
     </select>
+    <select id="getUnitByKind" resultType="com.rtrh.projects.modules.system.po.JUnit">
+        SELECT
+        id AS id,
+        kind AS kind,
+        code AS code,
+        title AS title,
+        reason AS reason,
+        name_zrr AS nameZrr,
+        name_lead AS nameLead,
+        tel AS tel,
+        name_pt AS namePt,
+        tel_pt AS telPt,
+        addre AS addre,
+        remark AS remark,
+        title_abb AS titleAbb,
+        province AS province,
+        city AS city,
+        area AS area,
+        postcode AS postcode,
+        kind_unit AS kindUnit,
+        kind_code AS kindCode,
+        group_code1 AS groupCode1,
+        group_code2 AS groupCode2,
+        trust_code AS trustCode,
+        amt AS amt,
+        sim_code AS simCode,
+        fax AS fax,
+        email AS email,
+        unit_prop_id AS unitPropId,
+        is_jur AS isJur,
+        unit_kind_id AS unitKindId,
+        date_found AS dateFound,
+        name_jur1 AS nameJur1,
+        sex1 AS sex1,
+        tel1 AS tel1,
+        sim_code1 AS simCode1,
+        fax_code1 AS faxCode1,
+        email1 AS email1,
+        kind1 AS kind1,
+        state1 AS state1,
+        country1 AS country1,
+        passport1 AS passport1,
+        name_jur2 AS nameJur2,
+        sex2 AS sex2,
+        tel2 AS tel2,
+        sim_code2 AS simCode2,
+        fax_code2 AS faxCode2,
+        email2 AS email2,
+        kind2 AS kind2,
+        state2 AS state2,
+        country2 AS country2,
+        passport2 AS passport2,
+        file_name AS fileName,
+        file_addre AS fileAddre,
+        file_prop AS fileProp,
+        status AS status,
+        name_sp AS nameSp,
+        date_sp AS dateSp,
+        subject_id AS subjectId
+        FROM
+        j_unit
+        <where>
+            logic_delete_flag = 0
+            <if test="code!=null and code!=''">
+                and kind=#{code}
+            </if>
+            order by code asc
+        </where>
+    </select>
 
 </mapper>

+ 4 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.java

@@ -113,4 +113,8 @@ public interface SubInfoMapper {
 
     @Select("SELECT count(1) FROM sub_info where id=#{id} and logic_delete_flag = 0")
     Integer selectById(@Param("id") String id);
+
+    void removeFour(@Param("id") String id);
+
+    void cancelRemove(@Param("id")String id);
 }

+ 13 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.xml

@@ -25,6 +25,12 @@
             WHERE id = #{item.id}
         </foreach>
     </update>
+    <update id="removeFour">
+        update sub_info set status="5",last_update_time = now() where id=#{id}
+    </update>
+    <update id="cancelRemove">
+        update sub_info set status="1",last_update_time = now() where id=#{id}
+    </update>
     <select id="exportSmzkDetailExcel" resultType="com.rtrh.projects.modules.projects.vo.export.SmzkDetailVo">
         SELECT sub_info.id as id,
         sub_info.sub_name as subName,
@@ -275,7 +281,14 @@
                     </if>
                 </if>
             </if>
+            <if test="vo.statusList!=null and vo.statusList.size()>0">
+                and s.status in
+                <foreach collection="vo.statusList" item="status" open="(" close=")" separator=",">
+                    #{status}
+                </foreach>
+            </if>
         </where>
+        order by last_update_time desc
     </select>
     <select id="queryStatistics" resultType="com.rtrh.projects.modules.projects.po.SubInfoGxj">
         select

+ 4 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/SubInfoService.java

@@ -453,4 +453,8 @@ public interface SubInfoService {
 	List<SmzkDetailVo> exportSmzkDetailExcel(SubInfoQueryTzVO vo, List<String> subjectIds);
 
     void importXmzkDetailExcel(List<List<Object>> readAll);
+
+	void removeFour(MoveDbParamVo vo, LoginUserVO loginUser);
+
+	void cancelRemove(MoveDbParamVo vo, LoginUserVO loginUser);
 }

+ 12 - 3
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoServiceImpl.java

@@ -4891,7 +4891,7 @@ public class SubInfoServiceImpl implements SubInfoService {
     @Override
     public boolean rg(MoveDbParamVo vo){
         return subInfoDao.updateBySql(
-                "update sub_info set rg_date = ?,is_rg=1 where id = ?",
+                "update sub_info set rg_date = ?,is_rg=1,last_update_time=now() where id = ?",
                 vo.getRgDate(),
                 vo.getId()
         ) > 0;
@@ -5901,12 +5901,12 @@ public class SubInfoServiceImpl implements SubInfoService {
             logOperate.setTitle(String.format("%s转%s",SubInfoStatusEnum.getDesc(subinfo.getStatus()),SubInfoStatusEnum.getDesc(vo.getStatus())));
             logOperateService.save(logOperate);
             if (!SubInfoStatusEnum.CB.getCode().equals(vo.getStatus())){
-                String sql = String.format("update sub_info set status='%s',%s=now() where id='%s'", vo.getStatus(), map.get(vo.getStatus()), vo.getId());
+                String sql = String.format("update sub_info set status='%s',last_update_time=now(),%s=now() where id='%s'", vo.getStatus(), map.get(vo.getStatus()), vo.getId());
                 int i = subInfoDao.updateBySql(sql);
                 return i > 0;
             }else {
                 // 移入储备库
-                String sql = String.format("update sub_info set status='%s' where id='%s'", vo.getStatus(),vo.getId());
+                String sql = String.format("update sub_info set status='%s',last_update_time=now() where id='%s'", vo.getStatus(),vo.getId());
                 int i = subInfoDao.updateBySql(sql);
                 return i > 0;
             }
@@ -5914,6 +5914,15 @@ public class SubInfoServiceImpl implements SubInfoService {
         return false;
     }
 
+    @Override
+    public void removeFour(MoveDbParamVo vo, LoginUserVO loginUser) {
+        subInfoMapper.removeFour(vo.getId());
+    }
+
+    @Override
+    public void cancelRemove(MoveDbParamVo vo, LoginUserVO loginUser) {
+        subInfoMapper.cancelRemove(vo.getId());
+    }
 
     public List<SubLabel> getSubLabels(SubLabelAddVO vo) {
         List<SubLabel> labelList = subLabelDao.findByCon(vo);

+ 1 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/vo/SubInfoQueryTzVO.java

@@ -48,6 +48,7 @@ public class SubInfoQueryTzVO {
      * 项目状态
      */
     private String status;
+    private List<String> statusList;
     /**
      * 查询时间类型
      */

+ 1 - 1
projects-service/src/main/java/com/rtrh/projects/modules/system/service/impl/JUnitServiceImpl.java

@@ -68,7 +68,7 @@ public class JUnitServiceImpl implements JUnitService {
 
 	@Override
 	public List<JUnit> getUnitByKind(JUnitKind kind) {
-
+		// return jUnitMapper.getUnitByKind(kind.getCode());
 		return jUnitDao.getUnitByKind(kind);
 	}
 

+ 2 - 0
projects/src/main/java/com/rtrh/projects/web/controller/subject/SubInfoController.java

@@ -237,6 +237,8 @@ public class SubInfoController extends BaseController {
         model.put("JSDD",byKind);   //项目属地
 
         model.put("TZXZ", tSysTableService.getByKind(SysTableKind.TZXZ));
+        model.put("subInfoStatus", SubInfoStatusEnum.values());
+
         model.put("HYDW", jUnitService.getUnitByKind(JUnitKind.ZFDW));
         model.put("BQ", tSysTableService.getByKind(SysTableKind.BQ));
         String currUserUnitId = getCurUser().getUnitId();

+ 30 - 0
projects/src/main/java/com/rtrh/projects/web/controller/subject/api/SubInfoApiController.java

@@ -1368,6 +1368,36 @@ public class SubInfoApiController extends BaseController {
         return message;
     }
 
+    /**
+     * 移除4库
+     */
+    @PostMapping(value = "/removeFour")
+    public Message removeFour(@RequestBody MoveDbParamVo vo) {
+        Message message = new Message();
+        try {
+            Assert.notBlank(vo.getId(), "项目ID不能为空");
+            subInfoService.removeFour(vo,getCurUser().getLoginUser());
+        } catch (Exception e) {
+            message.setSuccess(false);
+            message.add("移除失败");
+        }
+        return message;
+    }
+
+    /**
+     * 取消移除
+     */
+    @PostMapping(value = "/cancelRemove")
+    public Message cancelRemove(@RequestBody MoveDbParamVo vo) {
+        Message message = new Message();
+        try {
+            Assert.notBlank(vo.getId(), "项目ID不能为空");
+            subInfoService.cancelRemove(vo,getCurUser().getLoginUser());
+        } catch (Exception e) {
+            message.add("取消失败");
+        }
+        return message;
+    }
     // 入规
     @PostMapping(value = "/rg")
     public Message rg(@RequestBody MoveDbParamVo vo) {

+ 14 - 16
projects/src/main/webapp/vmodules/subject/subInfo/editSubInfo.jsp

@@ -112,7 +112,7 @@
                                 <label class="layui-form-label required"
                                 >项目代码</label>
                                 <div class="layui-input-block">
-                                    <input type="text" required lay-verify="required" placeholder="请输入"
+                                    <input type="text" placeholder="请输入"
                                            autocomplete="off" class="layui-input" v-model="subInfo.subCode">
                                 </div>
                             </div>
@@ -128,19 +128,19 @@
                         </div>
                     </div>
                     <div class="layui-row">
-                        <div class="layui-col-xs6 layui-col-sm6">
-                            <div class="layui-form-item">
-                                <label class="layui-form-label required">建设性质</label>
-                                <div class="layui-input-block">
-                                    <select lay-verify="required" v-model="subInfo.status" lay-filter="status" disabled>
-                                        <option value="">请选择</option>
-                                        <c:forEach items="${JSXZ}" var="js">
-                                            <option value="${js.code }">${js.title }</option>
-                                        </c:forEach>
-                                    </select>
-                                </div>
-                            </div>
-                        </div>
+<%--                        <div class="layui-col-xs6 layui-col-sm6">--%>
+<%--                            <div class="layui-form-item">--%>
+<%--                                <label class="layui-form-label required">建设性质</label>--%>
+<%--                                <div class="layui-input-block">--%>
+<%--                                    <select lay-verify="required" v-model="subInfo.status" lay-filter="status" disabled>--%>
+<%--                                        <option value="">请选择</option>--%>
+<%--                                        <c:forEach items="${JSXZ}" var="js">--%>
+<%--                                            <option value="${js.code }">${js.title }</option>--%>
+<%--                                        </c:forEach>--%>
+<%--                                    </select>--%>
+<%--                                </div>--%>
+<%--                            </div>--%>
+<%--                        </div>--%>
                         <div class="layui-col-xs6 layui-col-sm6">
                             <div class="layui-form-item">
                                 <label class="layui-form-label required"
@@ -160,9 +160,7 @@
                                 </div>
                             </div>
                         </div>
-                        <div class="layui-col-xs6 layui-col-sm6">
 
-                        </div>
                         <div class="layui-col-xs6 layui-col-sm6">
                             <div class="layui-form-item">
                                 <label class="layui-form-label required"

+ 53 - 24
projects/src/main/webapp/vmodules/subject/subInfo/tz/xmzk.jsp

@@ -174,9 +174,9 @@
                                 </div>
                                 <div class="layui-col-xs3 layui-col-sm3 layui-col-md3 hiddenParam">
                                     <div class="layui-form-item">
-                                        <label class="layui-form-label required label-longers">投资类型</label>
+                                        <label class="layui-form-label required label-longers">四库</label>
                                         <div class="layui-input-block">
-                                            <div id="kindNature"></div>
+                                            <div id="subInfoStatus"></div>
                                         </div>
                                     </div>
                                 </div>
@@ -420,6 +420,12 @@
         <span title="编辑" lay-event="toEditSubInfo" class="no-wrap">&nbsp;编辑</span>
         {{#} }}
         <span title="转库" lay-event="move" class="no-wrap">转库</span>
+        {{# if(d.status != '5') { }}
+        <span title="移出4库" lay-event="removeFour" class="no-wrap">移出4库</span>
+        {{#} }}
+        {{# if(d.status == '5') { }}
+        <span title="取消移除" lay-event="cancelRemove" class="no-wrap">取消移除</span>
+        {{#} }}
     </div>
 </script>
 
@@ -520,6 +526,7 @@
         el: "#app",
         template: "#template",
         data: {
+            subInfoStatusData: [],
             JSDD: [],
             winH: 0,
             dataList: [],
@@ -554,13 +561,8 @@
                     App.msg.error("请选择转库状态");
                     return;
                 }
-                const statusMap = {
-                    1: "储备",
-                    2: "新建",
-                    3: "在建",
-                    9: "投产"
-                };
-                param.statusName = statusMap[param.status] || "未知状态";
+                // param.statusName = this.getStatusName(param.status)
+                param.statusName = this.subInfoStatusData.find(item => item.value === param.status).name
                 let self = this;
                 self.closeAllLayers();
                 App.msg.confirm(`是否转入` + param.statusName + `库?`, () => {
@@ -574,6 +576,32 @@
                     })
                 });
             },
+            removeFour(obj){
+                let self = this;
+                App.msg.confirm(`是否移除`, () => {
+                    App.postJson("/api/subject/subInfo/removeFour", {id: obj.data.id}, (res) => {
+                        if (res.success) {
+                            App.msg.success("移除成功");
+                            self.getData()
+                        } else {
+                            App.msg.error(res.message || "移除失败,请重试");
+                        }
+                    })
+                })
+            },
+            cancelRemove(obj){
+                let self = this;
+                App.msg.confirm(`是否取消`, () => {
+                    App.postJson("/api/subject/subInfo/cancelRemove", {id: obj.data.id}, (res) => {
+                        if (res.success) {
+                            App.msg.success("取消成功");
+                            self.getData()
+                        } else {
+                            App.msg.error(res.message || "取消失败,请重试");
+                        }
+                    })
+                })
+            },
             move(obj) {
                 this.moveDbParam.id = obj.data.id
                 const formTemplate = document.getElementById('moveForm').innerHTML;
@@ -664,14 +692,14 @@
                 <%--});--%>
 
 
-                var kindNatureData = [];
-                <c:forEach items="${TZXZ}" var="xm">
-                kindNatureData.push({value: "${xm.code}", name: "${xm.title}"});
+                // var subInfoStatusData = [];
+                <c:forEach items="${subInfoStatus}" var="xm">
+                self.subInfoStatusData.push({value: "${xm.code}", name: "${xm.desc}"});
                 </c:forEach>
-                this.kindNature = layui.xmSelect.render({
-                    el: "#kindNature",
+                this.subInfoStatus = layui.xmSelect.render({
+                    el: "#subInfoStatus",
                     language: 'zn',
-                    data: kindNatureData
+                    data: self.subInfoStatusData
                 });
                 layui.laydate.render({
                     elem: '#year',
@@ -838,8 +866,8 @@
                 if (this.indusKind) {
                     param.indusKind = this.indusKind.getValue("valueStr");
                 }
-                if (this.kindNature) {
-                    param.kindNature = this.kindNature.getValue("valueStr");
+                if (this.subInfoStatus) {
+                    param.statusList = this.subInfoStatus.getValue("valueList").map(item => item.value);
                 }
                 delete (param.select);
                 /*     param.kind = this.kind.getValue("value").sort().join(",");*/
@@ -867,13 +895,13 @@
                 });
 
                 // 统计数据
-                App.postJson("/api/subInfo/query/statistics", param, function (res) {
-                    if (res.success) {
-                        self.beginRate = res.data;
-                        self.beginRate.hyflList = self.beginRate.hyflData;
-                        self.beginRate.jsddList = self.beginRate.jsddData;
-                    }
-                });
+                // App.postJson("/api/subInfo/query/statistics", param, function (res) {
+                //     if (res.success) {
+                //         self.beginRate = res.data;
+                //         self.beginRate.hyflList = self.beginRate.hyflData;
+                //         self.beginRate.jsddList = self.beginRate.jsddData;
+                //     }
+                // });
 
                 /*App.postJson("/api/subInfo/query/beginRate", param, function (res) {
                     if (res.success) {
@@ -921,6 +949,7 @@
                     '1': '储备',
                     '2': '新建',
                     '3': '在建',
+                    '5': '移除项目',
                     '9': '投产'
                 };
                 return statusMap[status] || '未知状态';

+ 1 - 1
projects/src/main/webapp/vmodules/top.jsp

@@ -99,7 +99,7 @@
                 <button class="layui-btn"
                     style="border-radius: 5px; background-color: #0073EF;"
                     @click="changeSystem"
-                >返回发改委系统</button>
+                >返回系统</button>
             </div>
         </li>
         <li class="layui-nav-item">

+ 1 - 1
projects/src/main/webapp/vmodules/top_old.jsp

@@ -97,7 +97,7 @@
         </li>
         <li class="layui-nav-item">
             <div style="display: flex; align-items: center; height: 100%;">
-                <button class="layui-btn" @click="changeSystem">返回发改委系统</button>
+                <button class="layui-btn" @click="changeSystem">返回系统</button>
             </div>
         </li>
         <li class="layui-nav-item">