ZHIHAO HU 5 лет назад
Родитель
Сommit
fd25c64415

+ 2 - 2
src/main/java/platform/modules/build/dao/CompanyDao.java

@@ -63,7 +63,7 @@ public interface CompanyDao extends BaseMapper<Company> {
     /*企业信息多条件模糊查询*/
     List<Company> findByConditions(@Param("companyInfoManageDto") CompanyInfoManageDto companyInfoManageDto);
 
-    List<Company> selectCompanyByCondition(@Param("street_id") Integer street_id, @Param("build_id") Integer build_id, @Param("param") String param);
+    List<Company> selectCompanyByCondition(@Param("street_id") Integer street_id, @Param("build_id") Integer build_id, @Param("param") String param, @Param("is_start") Boolean is_start);
 
     List<Company> findCompanyByCondition(@Param("currentStreet_id") Integer currentStreet_id,
                                          @Param("currentUserId") Integer currentUserId,
@@ -120,7 +120,7 @@ public interface CompanyDao extends BaseMapper<Company> {
      * @param keyword
      * @return
      */
-    List<Company> selectStockLandCompany(@Param("street_id") Integer street_id, @Param("keyword") String keyword);
+    List<Company> selectStockLandCompany(@Param("street_id") Integer street_id, @Param("build_id") Integer build_id, @Param("keyword") String keyword);
 
     List<StreetCompanys> getStreetCompanys();
 

+ 8 - 8
src/main/java/platform/modules/build/service/CompanyService.java

@@ -47,6 +47,7 @@ import platform.modules.sys.service.WaitToDoService;
 import platform.modules.sys.web.ResponseMessage;
 import tk.mybatis.mapper.entity.Example;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -64,7 +65,7 @@ public class CompanyService extends BaseService<Company> {
 
     private static Logger logger = LoggerFactory.getLogger(CompanyService.class);
 
-    @Autowired
+    @Resource
     private CompanyDao companyDao;
 
     @Autowired
@@ -101,7 +102,7 @@ public class CompanyService extends BaseService<Company> {
     @Autowired
     private SkyImageApiService skyImageApiService;
 
-    public PageInfo<Company> findPage(Integer pageNum, Integer pageSize, String param, CompanyDto companyDto) throws Exception {
+    public PageInfo<Company> findPage(Integer pageNum, Integer pageSize, String param, Boolean isStart, CompanyDto companyDto) throws Exception {
         /*Example example = new Example(Company.class);
         Example.Criteria criteria = example.createCriteria();
 
@@ -123,12 +124,10 @@ public class CompanyService extends BaseService<Company> {
         Integer build_id = ShiroUtils.getUserEntity().getBuild_id();
         Integer street_id = ShiroUtils.getUserEntity().getStreet_id();
         List<Company> contents = null;
-        if (StringUtils.isNotBlank(param)) {
-            String trim = param.trim();
-            contents = companyDao.selectCompanyByCondition(street_id, build_id, trim);
-        } else {
-            contents = companyDao.selectCompanyByCondition(street_id, build_id, param);
+        if (null != param) {
+            param = param.trim();
         }
+        contents = companyDao.selectCompanyByCondition(street_id, build_id, param, isStart);
         for (Company company : contents) {
             if (null != company.getType_id()) {
                 BuildType buildType = buildTypeService.findById(company.getType_id());
@@ -705,8 +704,9 @@ public class CompanyService extends BaseService<Company> {
                                                   CompanyDto companyDto) {
         PageHelper.startPage(pageNum, pageSize);
         Integer street_id = ShiroUtils.getUserEntity().getStreet_id();
+        Integer build_id = ShiroUtils.getUserEntity().getBuild_id();
         List<Company> companys = null;
-        companys = companyDao.selectStockLandCompany(street_id, keyword);
+        companys = companyDao.selectStockLandCompany(street_id, build_id, keyword);
         for (Company company : companys) {
             if (null != company.getType_id()) {
                 BuildType buildType = buildTypeService.findById(company.getType_id());

+ 16 - 19
src/main/java/platform/modules/build/web/CompanyController.java

@@ -81,10 +81,10 @@ public class CompanyController extends BaseController {
     @GetMapping(value = "/list")
     public String list(
             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-            String keyword, ModelMap modelMap,String item_selected) throws Exception {
+            String keyword, ModelMap modelMap, String item_selected) throws Exception {
         try {
             log.debug("分页查询公司列表参数! pageNum = {}, keyword = {}", pageNum, keyword);
-            PageInfo<Company> pageInfo = companyService.findPage(pageNum, PAGESIZE, keyword, new CompanyDto());
+            PageInfo<Company> pageInfo = companyService.findPage(pageNum, PAGESIZE, keyword, null, new CompanyDto());
             log.info("分页查询公司列表结果! pageInfo = {}", pageInfo);
             modelMap.put("pageInfo", pageInfo);
             modelMap.put("keyword", keyword);
@@ -95,7 +95,6 @@ public class CompanyController extends BaseController {
         return BASE_BUILD_PATH + "company_list";
     }
 
-
     /**
      * 跳转到公司添加页面
      *
@@ -119,11 +118,11 @@ public class CompanyController extends BaseController {
     @PostMapping(value = "/save")
     public ModelMap saveCompany(Company content) throws Exception {
         ModelMap messagesMap = new ModelMap();
-        if(IsTooFrequently()) {
-    		messagesMap.put("status", FAILURE);
+        if (IsTooFrequently()) {
+            messagesMap.put("status", FAILURE);
             messagesMap.put("message", "操作过于频繁,请稍后再试!");
             return messagesMap;
-    	}
+        }
         log.debug("添加公司参数! content = {}", content);
         Boolean flag = companyService.saveCompany(content);
         if (flag) {
@@ -186,9 +185,9 @@ public class CompanyController extends BaseController {
     public ResponseMessage updateCompany(@PathVariable("id") int id, Company content) throws Exception {
         ModelMap messagesMap = new ModelMap();
         log.debug("编辑公司参数! id= {}, content = {}", id, content);
-        if(IsTooFrequently()) {
-	        return ResponseMessage.success("操作过于频繁,请稍后再试!");
-    	}
+        if (IsTooFrequently()) {
+            return ResponseMessage.success("操作过于频繁,请稍后再试!");
+        }
         Company u = companyService.findById(id);
         if (null == u) {
             log.info("编辑公司不存在! id = {}", id);
@@ -215,7 +214,6 @@ public class CompanyController extends BaseController {
         if (null == ids) {
             log.info("批量删除公司不存在! ids = {}", ids);
             return ResponseMessage.success("批量删除公司不存在");
-
         }
         for (String id : ids) {
             Company company = new Company();
@@ -237,9 +235,9 @@ public class CompanyController extends BaseController {
     @ResponseBody
     @PutMapping(value = "/startBatch")
     public ResponseMessage startBatch(@RequestParam(value = "ids[]") String[] ids) throws Exception {
-    	if(IsTooFrequently()) {
-	        return ResponseMessage.success("操作过于频繁,请稍后再试!");
-    	}
+        if (IsTooFrequently()) {
+            return ResponseMessage.success("操作过于频繁,请稍后再试!");
+        }
         if (null == ids) {
             log.info("批量启用公司不存在! ids = {}", ids);
             return ResponseMessage.success("批量启用公司不存在");
@@ -264,9 +262,9 @@ public class CompanyController extends BaseController {
     @ResponseBody
     @PutMapping(value = "/stopBatch")
     public ResponseMessage stopBatch(@RequestParam(value = "ids[]") String[] ids) throws Exception {
-    	if(IsTooFrequently()) {
-	        return ResponseMessage.success("操作过于频繁,请稍后再试!");
-    	}
+        if (IsTooFrequently()) {
+            return ResponseMessage.success("操作过于频繁,请稍后再试!");
+        }
         if (null == ids) {
             log.info("批量启用公司不存在! ids = {}", ids);
             return ResponseMessage.success("批量启用公司不存在");
@@ -400,8 +398,8 @@ public class CompanyController extends BaseController {
         modelMap.put("company", company);
         List<Street> streetList = streetService.findList();
         modelMap.addAttribute("streetList", streetList);
-        if(null != company.getStreet_id()) {
-        	modelMap.addAttribute("buildList", buildInfoService.findListByStreet(company.getStreet_id()));
+        if (null != company.getStreet_id()) {
+            modelMap.addAttribute("buildList", buildInfoService.findListByStreet(company.getStreet_id()));
         }
         //查询企业性质
         List<DictionaryItem> companyTypeList = dictionaryItemService.findListByTypeName(Constant.DictionaryType.COMPANY_TYPE);
@@ -433,6 +431,5 @@ public class CompanyController extends BaseController {
         return BASE_COMPANY_PATH + "accountInfo/companyUserInfo";
     }
 
-    
 
 }

+ 13 - 14
src/main/java/platform/modules/build/web/ContractController.java

@@ -82,14 +82,14 @@ public class ContractController extends BaseController {
     @Autowired
     private BuildTypeService buildTypeService;
 
-    
+
     @Autowired
     private ElectricReadService electricReadService;
 
     @GetMapping(value = "/list")
     public String list(
             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-            String keyword, ModelMap modelMap,String item_selected) throws Exception {
+            String keyword, ModelMap modelMap, String item_selected) throws Exception {
         try {
             log.debug("分页查询合同列表参数! pageNum = {}, keyword = {}", pageNum, keyword);
             PageInfo<Contract> pageInfo = contractService.findPage(pageNum, PAGESIZE, keyword, false);
@@ -106,7 +106,7 @@ public class ContractController extends BaseController {
     @GetMapping(value = "/listByStatus")
     public String listByStatus(
             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-            String keyword, ModelMap modelMap,String item_selected) throws Exception {
+            String keyword, ModelMap modelMap, String item_selected) throws Exception {
         try {
             log.debug("分页查询合同列表参数! pageNum = {}, keyword = {}", pageNum, keyword);
             PageInfo<Contract> pageInfo = contractService.findPage(pageNum, PAGESIZE, keyword, true);
@@ -123,7 +123,7 @@ public class ContractController extends BaseController {
     @GetMapping(value = "/endList")
     public String endList(
             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-            String keyword, ModelMap modelMap,String item_selected) throws Exception {
+            String keyword, ModelMap modelMap, String item_selected) throws Exception {
         try {
             log.debug("分页查询合同列表参数! pageNum = {}, keyword = {}", pageNum, keyword);
             PageInfo<Contract> pageInfo = contractService.findEndContractPage(pageNum, PAGESIZE, keyword);
@@ -167,13 +167,13 @@ public class ContractController extends BaseController {
         ModelMap messagesMap = new ModelMap();
         //是否存在相同合同编号,是则是重复提交
         Contract existContract = contractService.findByContractNo(contract.getContract_no());
-    	if( null != existContract) {
-    		messagesMap.put("status", FAILURE);
+        if (null != existContract) {
+            messagesMap.put("status", FAILURE);
             messagesMap.put("message", "请勿重复提交!");
             return messagesMap;
-    	}
+        }
         log.debug("添加合同参数! contract = {}", contract);
-        
+
         Boolean flag = contractService.saveContract(contract);
 
         if (flag) {
@@ -672,12 +672,12 @@ public class ContractController extends BaseController {
 
         Company company = companyService.findByCompanyName(company_name);
         if (null != company) {
-        	if(null != company.getType_id()) {
-        		BuildType buildType = buildTypeService.findById(company.getType_id());
+            if (null != company.getType_id()) {
+                BuildType buildType = buildTypeService.findById(company.getType_id());
                 if (null != buildType) {
                     company.setType_name(buildType.getType());
                 }
-        	}
+            }
         }
         if (null != company) {
             company.setCompanyContacts(companyContactService.findByCompanyId(company.getId()));
@@ -689,7 +689,6 @@ public class ContractController extends BaseController {
         return ResponseMessage.error("不存在所输入公司,请先新增公司。");
     }
 
-
     /***
      * 选择客户(公司)
      * @return
@@ -702,7 +701,7 @@ public class ContractController extends BaseController {
             log.debug("分页查询合同列表参数! pageNum = {}, keyword = {}", pageNum, keyword);
             CompanyDto companyDto = new CompanyDto();
             companyDto.setIs_start(true);
-            PageInfo<Company> pageInfo = companyService.findPage(pageNum, PAGESIZE, keyword, companyDto);
+            PageInfo<Company> pageInfo = companyService.findPage(pageNum, PAGESIZE, keyword, true, companyDto);
             log.info("分页查询合同列表结果! pageInfo = {}", pageInfo);
             modelMap.put("pageInfo", pageInfo);
             modelMap.put("keyword", keyword);
@@ -717,7 +716,7 @@ public class ContractController extends BaseController {
         if (null != contract) {
             List<Attachment> attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.CONTRACT, contract.getId(), null);
             if (null != attachments && attachments.size() > 0) {
-                FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(),attachments.get(0).getDownload_uri());
+                FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
                 contract.setFileDown(fileDown);
                 return fileDown;
             }

+ 13 - 5
src/main/resources/mapper/build/CompanyDao.xml

@@ -296,6 +296,9 @@
         com.del_flag = 0
         AND
         com.is_register = 1
+        <if test="is_start!=null">
+            and com.is_start = #{is_start}
+        </if>
         <if test="street_id!=null">
             and com.street_id = #{street_id}
         </if>
@@ -645,11 +648,16 @@
         WHERE
         a.del_flag = 0
         and a.is_start = 1
-        and (
-        a.street_id=#{street_id}
-        or
-        a.id in (select company_id from y_company_building_street b where b.del_flag = 0 and b.street_id =#{street_id} )
-        )
+        <if test="street_id !=null">
+            and (
+            a.street_id=#{street_id}
+            or
+            a.id in (select company_id from y_company_building_street b where b.del_flag = 0 and b.street_id =#{street_id} )
+            )
+        </if>
+        <if test="build_id !=null">
+            and a.build_id=#{build_id}
+        </if>
         <if test="keyword !=null">
             and (
             (a.company_name LIKE CONCAT(CONCAT('%',#{keyword}), '%') )

+ 1 - 1
src/main/resources/mapper/company/StockLandDao.xml

@@ -244,7 +244,7 @@
 
 	<select id="getApplyDate" resultType="String">
 		select create_time from z_approval 
-        where APPLY_ID = #{id} order by create_time limit 0,1
+        where APPLY_ID = #{id} and TYPE = "存量用地" order by create_time limit 0,1
 	</select>
 
 	<!-- 审核通过的列表 -->

+ 17 - 0
src/main/resources/templates/admin/common/left.html

@@ -819,6 +819,23 @@
     </div>
     <!-- 政务服务管理 -->
     <div class="menu_dropdown bk_2" th:if="${user_type}==1">
+
+        <dl shiro:hasPermission="Y_STOCKLAND_MANAGE">
+            <dt class="titCellTop">
+                <span><i class="Hui-iconfont ft-18">&#xe621;</i> 存量用地</span>
+                <i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i>
+            </dt>
+            <dd>
+                <ul>
+                    <li shiro:hasPermission="Y_AREA_APPLY">
+                        <a
+                                data-menu="Y_AREA_APPLY"
+                                th:attr="data-href=@{/stockLand/applyList}" data-title="用地申请">用地申请</a>
+                        <i class="icon-arrow"></i>
+                    </li>
+                </ul>
+            </dd>
+        </dl>
         <dl shiro:hasPermission="Y_ACTIVITY_MANAGE">
             <dt class="titCellTop">
                 <span><i class="Hui-iconfont ft-18">&#xe611;</i> 活动管理</span>

+ 13 - 13
src/main/resources/templates/admin/company/stock_land/apply_add.html

@@ -36,7 +36,7 @@
         <input type="hidden" th:name="isDraft"  th:id="isDraft" th:value="0"/>
         <div class="line"><span class="c-red"></span>基本信息</div>
         <div id="companyInfo" >
-	        <div class="row cl" th:if="${userType==4}">
+	        <div class="row cl" th:if="${userType==4 || userType==1}">
 	            <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>申请企业:</label>
 	            <div class="formControls col-xs-8 col-sm-9">
 					<input type="text" readonly="readonly" style="width:48%" required placeholder="点击查找按钮查找公司"
@@ -114,7 +114,7 @@
             <div class="formControls col-xs-8 col-sm-9">
 				<span class="select-box">
                 <select class="select" th:name="apply_type"  onChange="changeType(this)">
-                    <option th:each="item : ${applyTypeList}" th:value="${item.value}" 
+                    <option th:each="item : ${applyTypeList}" th:value="${item.value}"
                     		th:text="${item.name}" th:selected = "${applyType}==${item.value}">
                     </option>
                 </select>
@@ -167,7 +167,7 @@
 		                	<input class="uploadFileTemplateId" type="hidden" th:name="${'applyMaterials['+iterStat.index+'].template_id'}" th:value="*{template_id}"/>
 		                	<input class="uploadFileName input-text" name="uploadFileName" readonly="readonly" type="text" th:onclick="'javascript:addFile(\'添加文件\',\'/stockLand/addApplyFile/1/'+*{template_id}+'\',\'800\',\'350\',this);'"/>
 		                	<input class="uploadFileId" type="hidden" th:name="${'applyMaterials['+iterStat.index+'].fileDown.file_id'}"/>
-		                	
+
 		                </td>
 		                <!-- &#xe706; -->
 		                <td class="delFile"><i onclick='deleteFile(this)' class='Hui-iconfont'>&#xe6a1; 删除</i></td>
@@ -226,7 +226,7 @@
 			        </table>
 	        </div>
         </div>
-        
+
         <div class="row cl">
             <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
         		<a class="btn btn-primary radius"  onclick="save(1)" >&nbsp;&nbsp;保存草稿&nbsp;&nbsp;</a>
@@ -252,7 +252,7 @@
 	/*function saveDraft(){
 		$("#isDraft").val(1);
 	}*/
-	
+
 	function summaryProcedureTypeChange(obj){
 		if($("#summaryProcedureType").find("input:checked").length==0){
 			$("#summaryMaterials").hide();
@@ -260,8 +260,8 @@
 			$("#summaryMaterials").show();
 		}
 	}
-	
-	
+
+
     function addFileLine(divId) {
    		var length = $("#"+divId).find(".add_file_line  tr").length;
         var html = "<i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1;</i>";
@@ -276,13 +276,13 @@
         $(obj).parent().parent().remove();
         setDocName();//重新设一下fileId域名称,不然顺序会乱掉,或出现两个相同的name
     }
-    
+
     function deleteFile(obj) {
         $(obj).parent().parent()
         .find(".uploadFileName").val("").end()
         .find(".uploadFileId").val("").end();
     }
-    
+
     //修改上传文件的fileId域名称
     function setDocName(){
     	$("#otherMaterials").find(".uploadFileId").each(function(i,item){
@@ -293,7 +293,7 @@
     	});
     }
 
-    
+
     /**
      * 取消
      */
@@ -301,7 +301,7 @@
         var index = parent.layer.getFrameIndex(window.name);
         parent.layer.close(index);
     }
-    
+
     function getCompanyInfo(){
    		$.ajax({
    	        type: 'post',
@@ -335,13 +335,13 @@
         }
         if (company.companyContacts.length > 0) {
         	var contact = company.companyContacts[0].contact;
-        	var phone = company.companyContacts[0].phone; 
+        	var phone = company.companyContacts[0].phone;
         	$("#companyInfo").find(".contact").val(contact);
         	$("#companyInfo").find(".contact_phone").val(phone);
         }
 
     }
-    
+
 </script>
 </body>
 </html>

+ 1 - 1
src/main/resources/templates/admin/company/stock_land/apply_edit.html

@@ -49,7 +49,7 @@
         <div class="line"><span class="c-red"></span>基本信息</div>
         <div id="companyInfo">
             <input type="hidden" th:name="companyInfo.id" th:id="companyInfoId" th:value="${companyInfo.id}"/>
-            <div class="row cl" th:if="${userType==4}">
+            <div class="row cl" th:if="${userType==4||userType==1}">
                 <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>申请企业:</label>
                 <div class="formControls col-xs-8 col-sm-9">
                     <input type="text" readonly="readonly" style="width:48%" required placeholder="点击查找按钮查找公司"