Pārlūkot izejas kodu

项目选择功能修改

user5 3 gadi atpakaļ
vecāks
revīzija
df35f3f29e

+ 43 - 17
src/main/java/com/jeeplus/modules/projectmaterialstorage/web/ProjectMaterialStorageController.java

@@ -2,31 +2,22 @@ package com.jeeplus.modules.projectmaterialstorage.web;
 
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
-import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.ThisLocalityDownloadUtil;
-import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage;
 import com.jeeplus.modules.projectmaterialstorage.service.ProjectMaterialStorageService;
-import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
+import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsExport;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
-import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
-import com.jeeplus.modules.sys.entity.Area;
 import com.jeeplus.modules.sys.utils.UserUtils;
-import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
-import com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate;
-import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workreceiptsregister.entity.ResponseEntity;
-import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.annotation.Id;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
@@ -35,7 +26,8 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.text.SimpleDateFormat;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -47,7 +39,9 @@ public class ProjectMaterialStorageController extends BaseController {
     @Autowired
     private ProjectMaterialStorageService projectMaterialStorageService;
     @Autowired
-    private RuralProjectRecordsService projectRecordsService;
+    private RuralProjectRecordsService ruralProjectRecordsService;
+    @Autowired
+    protected ProjectRecordsService projectRecordsService;
 
     @ModelAttribute
     public ProjectMaterialStorage get(@RequestParam(required = false) String id){
@@ -95,9 +89,9 @@ public class ProjectMaterialStorageController extends BaseController {
             projectMaterialStorage.setRemarks(" ");
         }
         projectMaterialStorageService.save(projectMaterialStorage);
-        RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectMaterialStorage.getProjectNumber());
+        RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectMaterialStorage.getProjectNumber());
         ruralProjectRecords.setprojectMaterialStorageStatus("2");
-        projectRecordsService.modfiyProjectMaterialStorageStatus(ruralProjectRecords);
+        ruralProjectRecordsService.modfiyProjectMaterialStorageStatus(ruralProjectRecords);
         return "redirect:"+Global.getAdminPath()+"/project/projectMaterialStorage/?repage";
     }
 
@@ -160,7 +154,7 @@ public class ProjectMaterialStorageController extends BaseController {
     @RequestMapping(value = "form")
     public String form(RuralProjectRecords projectRecords, Model model) {
         if (projectRecords != null && StringUtils.isNotBlank(projectRecords.getId())) {
-            projectRecords = projectRecordsService.getQueryProjectUsers(projectRecords.getId());
+            projectRecords = ruralProjectRecordsService.getQueryProjectUsers(projectRecords.getId());
 //            RuralProjectcontentinfo ruralProjectcontentinfo = projectRecordsService.formAccessory(projectRecords);
 //            projectRecordsService.disposeData(ruralProjectcontentinfo);
 //            model.addAttribute("projectcontentinfo", ruralProjectcontentinfo);
@@ -234,5 +228,37 @@ public class ProjectMaterialStorageController extends BaseController {
     }
 
 
+    /**
+     * 选择开票项目
+     */
+    @RequestMapping(value = "selectproject")
+    public String selectproject(ProjectRecords project, String url, String fieldLabels, String fieldKeys, String searchLabel, String searchKey, String ids, Integer isProject, Integer isProjectFalg, String details, HttpServletRequest request, HttpServletResponse response, Model model) {
+        project.setCompany(UserUtils.getSelectCompany());
+        project.setProjectStatus(ProjectStatusEnum.SIGNED.getValue());//已签状态
+        Page<ProjectRecords> page = projectRecordsService.ruralFindPage(new Page<ProjectRecords>(request, response), project);
+        List<ProjectRecords> list = page.getList();
+        try {
+            fieldLabels = URLDecoder.decode(fieldLabels, "UTF-8");
+            fieldKeys = URLDecoder.decode(fieldKeys, "UTF-8");
+            searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
+            searchKey = URLDecoder.decode(searchKey, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+            logger.error("Exception e:"+e);
+        }
+        model.addAttribute("labelNames", fieldLabels.split("\\|"));
+        model.addAttribute("labelValues", fieldKeys.split("\\|"));
+        model.addAttribute("fieldLabels", fieldLabels);
+        model.addAttribute("fieldKeys", fieldKeys);
+        model.addAttribute("url", url);
+        model.addAttribute("searchLabel", searchLabel);
+        model.addAttribute("searchKey", searchKey);
+        project.setDetails(details);
+        model.addAttribute("obj", project);
+        model.addAttribute("isProject", isProject);
+        model.addAttribute("isProjectFalg", isProjectFalg);
+        model.addAttribute("page",page);
+        return "modules/sys/gridMaterialProject";
+    }
 
 }

+ 195 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -3979,6 +3979,201 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
 
 
     /**
+     * 根据项目id 和 documentId生成合同id
+     * @param projectId
+     * @param documentList
+     * @return
+     */
+    public HashMap getSignatureContractId1(String projectId, List<String> documentList ,String principalUserId,String generalManagerUserId){
+        HashMap hashMap = new HashMap();
+        Set<String> serialIdSet = new HashSet<>();
+        //根据项目id查询项目信息
+        RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
+        //创建签署方信息
+        List<Action> actions = Lists.newArrayList();
+        Action companyAction = new Action();
+        companyAction.setType("CORPORATE");
+        companyAction.setName("公司印章");
+        companyAction.setSerialNo("1");
+        //公司圆章-竖
+        serialIdSet.add(COMPANYROUNDSEALIDVERTICAL);
+        //添加盖章位置
+        List<Location> locations = Lists.newArrayList();
+        for (String documentId: documentList) {
+            Location location = new Location();
+            location.setSealId(COMPANYROUNDSEALIDVERTICAL);
+            location.setDocumentId(documentId);
+            location.setPage("0");
+            location.setRectType("SEAL_CORPORATE");
+            location.setKeywordIndex(-1);
+            location.setOffsetX("0.5264");
+            location.setOffsetY("0.6787");
+            locations.add(location);
+        }
+
+        //根据角色信息录入签署方信息
+        //负责人
+        if(StringUtils.isNotBlank(principalUserId)){
+            User user = UserUtils.get(principalUserId);
+            if(null != user){
+                //获取成员印章id信息
+                String userSealId = SignaturePostUtil.getUserSealByMobile(user.getMobile(),"",user.getName() + "一级注册造价工程师章-竖");
+                if(StringUtils.isNotBlank(userSealId)){
+                    for (String documentId: documentList) {
+                        //添加盖章位置
+                        Location principalLocation = new Location();
+                        serialIdSet.add(userSealId);
+                        principalLocation.setSealId(userSealId);
+                        principalLocation.setDocumentId(documentId);
+                        principalLocation.setPage("0");
+                        principalLocation.setRectType("SEAL_CORPORATE");
+                        principalLocation.setKeywordIndex(-1);
+                        principalLocation.setOffsetX("0.5971");
+                        principalLocation.setOffsetY("0.8176");
+                        locations.add(principalLocation);
+                    }
+                }else{
+                    hashMap.put("code","2");
+                    hashMap.put("message","查询不到项目负责人 "+ user.getName() + " 的印章信息!请联系管理员");
+                    return hashMap;
+                }
+            }
+        }else{
+            hashMap.put("code","2");
+            hashMap.put("message","查询不到项目负责人信息!请联系管理员");
+            return hashMap;
+        }
+        //总经理
+        User technologyPrincipalUser = UserUtils.getByLoginName("陈红星");
+        if(null != technologyPrincipalUser){
+            //获取成员印章id信息
+            String userSealId = SignaturePostUtil.getUserSealByMobile(technologyPrincipalUser.getMobile(),"","陈红星个人签名章-竖");
+            if(StringUtils.isNotBlank(userSealId)){
+                for (String documentId: documentList) {
+                    //添加盖章位置
+                    Location principalLocation = new Location();
+                    serialIdSet.add(userSealId);
+                    principalLocation.setSealId(userSealId);
+                    principalLocation.setDocumentId(documentId);
+                    principalLocation.setPage("0");
+                    principalLocation.setRectType("SEAL_CORPORATE");
+                    principalLocation.setKeywordIndex(-1);
+                    principalLocation.setOffsetX("0.7758");
+                    principalLocation.setOffsetY("0.7339");
+                    locations.add(principalLocation);
+                }
+
+            }else{
+                hashMap.put("code","2");
+                hashMap.put("message","查询不到技术负责人 陈红星 的印章信息!请联系管理员");
+                return hashMap;
+            }
+        }else{
+            hashMap.put("code","2");
+            hashMap.put("message","查询不到技术负责人信息!请联系管理员");
+            return hashMap;
+        }
+        List<String> serialIdList = new ArrayList<String>(serialIdSet);
+        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
+        companyAction.setAutoSign("true");
+        companyAction.setLocations(locations);
+        actions.add(companyAction);
+
+        //创建个人职业章参数
+        Action professionalChapterAction = new Action();
+        professionalChapterAction.setType("PRACTICE");
+        professionalChapterAction.setName("个人职业章");
+        professionalChapterAction.setSerialNo("1");
+
+        //添加盖章位置
+        List<Location> professionalChapterLocations = Lists.newArrayList();
+
+        Set<String> professionalChapterSerialIdSet = new HashSet<>();
+
+        //添加个人职业章人员信息
+        ActionOperatorInfo actionOperatorInfo = new ActionOperatorInfo();
+        actionOperatorInfo.setOperatorContact("15240492484");
+        List<ActionOperatorInfo> actionOperators = Lists.newArrayList();
+        professionalChapterAction.setActionOperators(actionOperators);
+
+        //获取成员印章id信息
+        String userSealId = SignaturePostUtil.getUserSealByMobile("15240492484","","杨荣华个人签名");
+        if(StringUtils.isNotBlank(userSealId)){
+            for (String documentId: documentList) {
+                //添加盖章位置
+                Location principalLocation = new Location();
+                professionalChapterSerialIdSet.add(userSealId);
+                principalLocation.setSealId(userSealId);
+                principalLocation.setDocumentId(documentId);
+                principalLocation.setPage("0");
+                principalLocation.setRectType("SEAL_CORPORATE");
+                principalLocation.setKeywordIndex(-1);
+                principalLocation.setOffsetX("0.5971");
+                principalLocation.setOffsetY("0.8176");
+                professionalChapterLocations.add(principalLocation);
+            }
+        }else{
+            hashMap.put("code","2");
+            hashMap.put("message","查询不到项目负责人 的印章信息!请联系管理员");
+            return hashMap;
+        }
+
+        /*//获取成员印章id信息
+        String userSealId2 = SignaturePostUtil.getUserSealByMobile("18351935168","","陈红星造价工程师章");
+        if(StringUtils.isNotBlank(userSealId2)){
+            for (String documentId: documentList) {
+                //添加盖章位置
+                Location principalLocation = new Location();
+                professionalChapterSerialIdSet.add(userSealId2);
+                principalLocation.setSealId(userSealId2);
+                principalLocation.setDocumentId(documentId);
+                principalLocation.setPage("0");
+                principalLocation.setRectType("SEAL_CORPORATE");
+                principalLocation.setKeywordIndex(-1);
+                principalLocation.setOffsetX("0.7758");
+                principalLocation.setOffsetY("0.7339");
+                professionalChapterLocations.add(principalLocation);
+            }
+
+        }*/
+
+        List<String> serialIdsList = new ArrayList<String>(professionalChapterSerialIdSet);
+        professionalChapterAction.setSealIds("[" + String.join(",", serialIdsList) + "]");
+        professionalChapterAction.setLocations(locations);
+        net.sf.json.JSONObject professionalChapterJson = net.sf.json.JSONObject.fromObject(professionalChapterAction);
+        System.out.println(professionalChapterJson.toString());
+        actions.add(professionalChapterAction);
+
+
+
+
+
+
+        //创建签署方信息表
+        List<SignatorieInfo> signatories = Lists.newArrayList();
+        SignatorieInfo signatorieInfo1 = new SignatorieInfo();
+        signatorieInfo1.setSerialNo("1");
+        signatorieInfo1.setTenantName("江苏兴光项目管理有限公司");
+        signatorieInfo1.setTenantType("COMPANY");
+        signatorieInfo1.setActions(actions);
+        signatories.add(signatorieInfo1);
+        SignatureContract signatureContract = new SignatureContract();
+        signatureContract.setDocuments(documentList);
+        //审定单用印流程id
+        signatureContract.setCategoryId(APPROVALCATEGORYID);
+        signatureContract.setSend(true);
+        signatureContract.setSignatories(signatories);
+        signatureContract.setSn("");
+        signatureContract.setSubject(ruralProjectRecords.getProjectName());//添加项目名称
+        net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(signatureContract);
+        String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
+        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
+
+        return hashMap;
+    }
+
+
+    /**
      * 根据项目id 和 documentId生成合同id(盐城)
      * @param projectId
      * @param documentList

+ 1 - 1
src/main/webapp/webpage/modules/projectMaterialStorage/projectMaterialStorageTwoForm.jsp

@@ -93,7 +93,7 @@
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label"><span class="require-item invoicetype">*</span>项目名称</label>
 					<div class="layui-input-block">
-						<sys:gridselectprojectmaterial url="${ctx}/workinvoiceTwo/workinvoiceTwo/selectproject" id="project" name="projectNumber"  value="${projectMaterialStorage.projectName}"  title="选择所属项目" labelName="projectName" cssStyle="background-color: #fff"
+						<sys:gridselectprojectmaterial url="${ctx}/project/projectMaterialStorage/selectproject" id="project" name="projectNumber"  value="${projectMaterialStorage.projectName}"  title="选择所属项目" labelName="projectName" cssStyle="background-color: #fff"
 													  labelValue="${projectMaterialStorage.projectName}" cssClass="form-control required layui-input" fieldLabels="项目名称" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName"  ></sys:gridselectprojectmaterial>
 					</div>
 				</div>