Sfoglia il codice sorgente

项目合同信息增查

user5 4 anni fa
parent
commit
453e8736eb

+ 0 - 23
src/main/java/com/jeeplus/modules/projectConstruction/dao/ContractDao.java

@@ -20,28 +20,5 @@ import java.util.Map;
 @MyBatisDao
 public interface ContractDao extends CrudDao<ConstructionContract> {
 
-
-    int getBeUsedCount1(String clientId);
-    int getBeUsedCount2(String clientId);
-    int getBeUsedCount3(String clientId);
-    int getBeUsedCount4(String clientId);
-    int getBeUsedCount5(String clientId);
-
-    int countByUscCode(String uscCode);
     int queryCount(ConstructionContract constructionContract);
-
-
-    List<WorkClientInfo> findByName(WorkClientInfo workClientInfo);
-
-    List<MainDictDetail> getJobTypeById(String id);
-
-    int getCount(WorkClientInfo workClientInfo);
-
-    List<WorkClientInfo> findList3(WorkClientInfo workClientInfo);
-    //根据统一社会信用代码查出来对应的客户信息表
-    WorkClientInfo findWorkClientInfo(WorkClientInfo workClientInfo);
-    //根据客户信息表查出来对应的联系人类型
-    List<Map> getJopType(WorkClientInfo work);
-
-    int insertContract(ConstructionContract constructionContract);
 }

+ 17 - 33
src/main/java/com/jeeplus/modules/projectConstruction/service/ContractService.java

@@ -52,35 +52,12 @@ import java.util.Map;
 @Service
 @Transactional(readOnly = true)
 public class ContractService extends CrudService<ContractDao,ConstructionContract> {
-
-	@Autowired
-	private WorkClientLinkmanDao workClientLinkmanDao;
-	@Autowired
-	private WorkClientBankDao workClientBankDao;
-	@Autowired
-	private WorkClientAttachmentDao workClientAttachmentDao;
-    @Autowired
-    private WorkContractInfoDao workContractInfoDao;
-    @Autowired
-    private WorkClientInfoDao workClientInfoDao;
-    @Autowired
-    private SerialNumTplService serialNumTplService;
     @Autowired
     private ContractDao contractDao;
 
-    @Autowired
-    private AreaDao areaDao;
-
-    private static MainDictService mainDictService = SpringContextHolder.getBean(MainDictService.class);
-
-    private static MainDictDetailDao mainDictDetailDao = SpringContextHolder.getBean(MainDictDetailDao.class);
-
-
-
-
     /**
      * 获取客户列表信息
-     * @param ConstructionContract
+     * @param
      * @return
      */
 	public List<ConstructionContract> findList(ConstructionContract constructionContract) {
@@ -90,7 +67,7 @@ public class ContractService extends CrudService<ContractDao,ConstructionContrac
     /**
      * 获取一个客户信息
      * @param page 分页对象
-     * @param ConstructionContract
+     * @param
      * @return
      */
     public Page<ConstructionContract> findPage(Page<ConstructionContract> page, ConstructionContract constructionContract) {
@@ -98,23 +75,30 @@ public class ContractService extends CrudService<ContractDao,ConstructionContrac
         //根据项目类型获取对应的客户id个数
         int count = contractDao.queryCount(constructionContract);
         page.setCount(count);
-        long t2 = System.currentTimeMillis();
-        logger.info("查询客户总数耗时:{}",t2-t1);
         page.setCountFlag(false);
         constructionContract.setPage(page);
         List<ConstructionContract> list = findList(constructionContract);
-        long t3 = System.currentTimeMillis();
-        logger.info("查询客户列表耗时:{}",t3-t2);
-        long t4 = System.currentTimeMillis();
-        logger.info("查询客户详情耗时:{}",t4-t3);
-        logger.info("查询客户总耗时:{}",t4-t1);
         page.setList(list);
         return page;
     }
 
 
+    /**
+     * 新增方法
+     * @param constructionContract
+     * @return
+     */
+    @Transactional(readOnly = false)
     public int insertContract(ConstructionContract constructionContract) {
-        int count=contractDao.insertContract(constructionContract);
+        Integer count = null;
+        //判断是否为修改信息
+        if (constructionContract.getIsNewRecord()){
+            constructionContract.preInsert();
+            count = dao.insert(constructionContract);
+        }else{
+            constructionContract.preUpdate();
+            count = dao.update(constructionContract);
+        }
         return count;
     }
 }

+ 10 - 260
src/main/java/com/jeeplus/modules/projectConstruction/web/ContractController.java

@@ -86,27 +86,11 @@ public class ContractController extends BaseController {
 
     @Autowired
     private ProjectRecordsService projectRecordsService;
-
-    @Autowired
-    private WorkContractInfoService contractInfoService;
-    @Autowired
-    private ActTaskService actTaskService;
-    @Autowired
-    private ActivityService activityService;
-    @Autowired
-    private ProjectReportDataService projectReportDataService;
-    @Autowired
-    private ProjectcontentinfoService projectcontentinfoService;
     @Autowired
     private ContractService contractService;
     @Autowired
-    private ProjectContentDataService projectContentDataService;
-    @Autowired
     private ProjectImplementEarlyService projectImplementEarlyService;
 
-    private static String template_path = Global.getProjectTemplatePath()+"咨询工作方案.xlsx";
-    private static String template_name = "咨询工作方案.xlsx";
-
     @ModelAttribute
     public ProjectRecords get(@RequestParam(required=false) String id) {
         ProjectRecords entity = null;
@@ -123,30 +107,14 @@ public class ContractController extends BaseController {
      * 项目列表页面
      */
     @RequiresPermissions("project:constructionContract:list")
-   /* @RequestMapping(value = {"list", ""})
+    @RequestMapping(value = {"list", ""})
     public String list(ConstructionContract constructionContract, HttpServletRequest request, HttpServletResponse response, Model model) {
-
-
         if(UserUtils.isManager()){
             model.addAttribute("flag","1");
         }
         Page<ConstructionContract> page = contractService.findPage(new Page<ConstructionContract>(request, response), constructionContract);
         model.addAttribute("page", page);
         return "modules/projectConstruction/projectConstructionList";
-    }*/
-    @RequestMapping(value = {"list", ""})
-    public String list(WorkClientInfo workClientInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
-        WorkClientLinkman workClientLinkman = workClientInfo.getWorkClientLinkman();
-        if(workClientLinkman != null){
-            workClientLinkman.setId("");
-        }
-        workClientInfo.setWorkClientLinkman(workClientLinkman);
-        if(UserUtils.isManager()){
-            model.addAttribute("flag","1");
-        }
-        Page<WorkClientInfo> page = workClientInfoService.findPage(new Page<WorkClientInfo>(request, response), workClientInfo);
-        model.addAttribute("page", page);
-        return "modules/projectConstruction/projectConstructionList";
     }
 
 
@@ -174,238 +142,20 @@ public class ContractController extends BaseController {
     /**
      * 添加合同数据
      */
+    @RequiresPermissions(value={"project:constructionContract:add","project:constructionContract:edit"})
     @RequestMapping(value = "save")
-    public String save(ConstructionContract constructionContract, Model model) {
-        int count=contractService.insertContract(constructionContract);
-        return "modules/projectConstruction/projectConstructionForm";
+    public String save(ConstructionContract constructionContract, Model model, RedirectAttributes redirectAttributes) {
+        contractService.insertContract(constructionContract);
+        return "redirect:"+Global.getAdminPath()+"//project/constructionContract/?repage";
     }
 
     @RequestMapping("selectcontent")
     public String gridSelect(ProjectImplementEarly projectRecords, String searchLabel ,HttpServletRequest request, HttpServletResponse response, Model model) throws UnsupportedEncodingException {
-        /*Page<ProjectContentData> page = projectContentDataService.findPage(new Page<ProjectContentData>(request, response), projectContentData);
-        model.addAttribute("obj", projectContentData);
-        model.addAttribute("page", page);
-        searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
-        model.addAttribute("searchLabel",searchLabel);*/
-
-
-        if(UserUtils.isManager()){
-            model.addAttribute("flag","1");
-        }
-        Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
-        //无合同状态下,获取委托方的名称
-        List<ProjectImplementEarly> list = page.getList();
-        List<ProjectRecordTreeData> projectRecordTreeDataList = new ArrayList<>();
-        Map<String,List> map = new HashMap<>();
-        for (int i = 0; i < list.size(); i++) {
-            ProjectRecordTreeData projectRecordTreeData = new ProjectRecordTreeData();
-            ProjectImplementEarly records1 = list.get(i);
-            if (records1.getWorkContractInfo() == null) {
-                if (records1.getWorkClientLinkmanList() != null && records1.getWorkClientLinkmanList().size() > 0) {
-                    WorkClientLinkman linkman = records1.getWorkClientLinkmanList().get(0);
-                    WorkContractInfo contractInfo = new WorkContractInfo();
-                    contractInfo.setClient(linkman.getClientId());
-                    records1.setWorkContractInfo(contractInfo);
-                }
-            }
-            //将界面需要展示数据放入类中
-            projectRecordTreeData.setId(records1.getId());
-            projectRecordTreeData.setProjectName(records1.getProjectName());
-            projectRecordTreeData.setProjectId(records1.getProjectId());
-            projectRecordTreeData.setProjectContentId(records1.getProjectContentId());
-            if(null!= records1.getWorkContractInfo()){
-                projectRecordTreeData.setContractName(records1.getWorkContractInfo().getName());
-                projectRecordTreeData.setClientName(records1.getWorkContractInfo().getClient().getName());
-            }else{
-                projectRecordTreeData.setContractName("");
-                projectRecordTreeData.setClientName("");
-            }
-            projectRecordTreeData.setProjectStatus(records1.getProjectStatus());
-            projectRecordTreeData.setProjectRegistrant(records1.getProjectRegistrant());
-            projectRecordTreeData.setCreateDate(records1.getCreateDate());
-            projectRecordTreeData.setCreateId(records1.getCreateBy().getId());
-            //父节点的pid设置为0
-            projectRecordTreeData.setPid("0");
-            //遍历项目负责人信息
-            List<User> masterUserList = records1.getProjectLeaders();
-            List<String> masterList = new ArrayList<>();
-            Set masterIdSet = new HashSet();
-            for (User masterUser:masterUserList) {
-                masterList.add(masterUser.getName());
-                masterIdSet.add(masterUser.getId());
-            }
-            //masterIdSet.add(records1.getCreateBy().getId());
-            //Set转List
-            List<String> masterIdList = new ArrayList<>(masterIdSet);
-            //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
-            for (String masterId : masterIdList) {
-                if(masterId.equals(UserUtils.getUser().getId())){
-                    projectRecordTreeData.setOperationSign(1);
-                    break;
-                }else{
-                    projectRecordTreeData.setOperationSign(0);
-                }
-            }
-
-            //项目负责人list数据转String
-            String projectLeader = masterList.toString().replaceAll("(?:\\[|null|\\]| +)", "");
-            projectRecordTreeData.setProjectLeader(projectLeader);
-            projectRecordTreeData.setLoginId(UserUtils.getUser().getId());
-            projectRecordTreeDataList.add(projectRecordTreeData);
-
-            //获取阶段Type父节点信息
-            String projectType = projectImplementEarlyService.getProjectType(records1.getProjectTypeId(), "实施前期");
-            //根据项目id查询相关的项目阶段内容
-            List<ProjectRecordTreeData> reportDataList = projectContentDataService.getProjectContentDataList(records1.getId(),projectType);
-            if(0 != reportDataList.size()){
-                Projectcontentinfo select = new Projectcontentinfo();
-                ProjectRecords project = new ProjectRecords();
-                project.setId(records1.getId());
-                select.setParentIds("0,");
-                select.setProject(project);
-                List<Projectcontentinfo> p = projectcontentinfoService.findListByProject(select);
-                for (ProjectRecordTreeData reportData : reportDataList) {
-                    //添加工作内容id
-                    if(p.size()>0){
-                        reportData.setContentPId(p.get(0).getId());
-                        reportData.setParentIds("0,");
-                        reportData.setDictType("");
-                    }
-                    //将项目所属类型名称放入树形列表的projectId中
-                    reportData.setProjectId(reportData.getProjectLeader());
-                    //添加项目负责人
-                    reportData.setProjectLeader(projectLeader);
-                    //添加登陆者id
-                    reportData.setLoginId(UserUtils.getUser().getId());
-                    reportData.setCreateId(records1.getCreateBy().getId());
-                    //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
-                    for (String masterId : masterIdList) {
-                        if(masterId.equals(UserUtils.getUser().getId())){
-                            reportData.setOperationSign(1);
-                            break;
-                        }else{
-                            reportData.setOperationSign(0);
-                        }
-                    }
-                }
-            }
-            projectRecordTreeDataList.addAll(reportDataList);
-
-        }
-
-        return "modules/sys/gridselectProjcontent";
-    }
-
-    /**
-     * 项目列表页面
-     */
-    @RequestMapping(value = "getProjectList")
-    @ResponseBody
-    public Map<String,List> getProjectList(ProjectImplementEarly projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
-        if(UserUtils.isManager()){
-            model.addAttribute("flag","1");
-        }
+        model.addAttribute("obj", projectRecords);
         Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
-        //无合同状态下,获取委托方的名称
-        List<ProjectImplementEarly> list = page.getList();
-        List<ProjectRecordTreeData> projectRecordTreeDataList = new ArrayList<>();
-        Map<String,List> map = new HashMap<>();
-        for (int i = 0; i < list.size(); i++) {
-            ProjectRecordTreeData projectRecordTreeData = new ProjectRecordTreeData();
-            ProjectImplementEarly records1 = list.get(i);
-            if (records1.getWorkContractInfo() == null) {
-                if (records1.getWorkClientLinkmanList() != null && records1.getWorkClientLinkmanList().size() > 0) {
-                    WorkClientLinkman linkman = records1.getWorkClientLinkmanList().get(0);
-                    WorkContractInfo contractInfo = new WorkContractInfo();
-                    contractInfo.setClient(linkman.getClientId());
-                    records1.setWorkContractInfo(contractInfo);
-                }
-            }
-            //将界面需要展示数据放入类中
-            projectRecordTreeData.setId(records1.getId());
-            projectRecordTreeData.setProjectName(records1.getProjectName());
-            projectRecordTreeData.setProjectId(records1.getProjectId());
-            projectRecordTreeData.setProjectContentId(records1.getProjectContentId());
-            if(null!= records1.getWorkContractInfo()){
-                projectRecordTreeData.setContractName(records1.getWorkContractInfo().getName());
-                projectRecordTreeData.setClientName(records1.getWorkContractInfo().getClient().getName());
-            }else{
-                projectRecordTreeData.setContractName("");
-                projectRecordTreeData.setClientName("");
-            }
-            projectRecordTreeData.setProjectStatus(records1.getProjectStatus());
-            projectRecordTreeData.setProjectRegistrant(records1.getProjectRegistrant());
-            projectRecordTreeData.setCreateDate(records1.getCreateDate());
-            projectRecordTreeData.setCreateId(records1.getCreateBy().getId());
-            //父节点的pid设置为0
-            projectRecordTreeData.setPid("0");
-            //遍历项目负责人信息
-            List<User> masterUserList = records1.getProjectLeaders();
-            List<String> masterList = new ArrayList<>();
-            Set masterIdSet = new HashSet();
-            for (User masterUser:masterUserList) {
-                masterList.add(masterUser.getName());
-                masterIdSet.add(masterUser.getId());
-            }
-            //masterIdSet.add(records1.getCreateBy().getId());
-            //Set转List
-            List<String> masterIdList = new ArrayList<>(masterIdSet);
-            //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
-            for (String masterId : masterIdList) {
-                if(masterId.equals(UserUtils.getUser().getId())){
-                    projectRecordTreeData.setOperationSign(1);
-                    break;
-                }else{
-                    projectRecordTreeData.setOperationSign(0);
-                }
-            }
-
-            //项目负责人list数据转String
-            String projectLeader = masterList.toString().replaceAll("(?:\\[|null|\\]| +)", "");
-            projectRecordTreeData.setProjectLeader(projectLeader);
-            projectRecordTreeData.setLoginId(UserUtils.getUser().getId());
-            projectRecordTreeDataList.add(projectRecordTreeData);
-
-            //获取阶段Type父节点信息
-            String projectType = projectImplementEarlyService.getProjectType(records1.getProjectTypeId(), "实施前期");
-            //根据项目id查询相关的项目阶段内容
-            List<ProjectRecordTreeData> reportDataList = projectContentDataService.getProjectContentDataList(records1.getId(),projectType);
-            if(0 != reportDataList.size()){
-                Projectcontentinfo select = new Projectcontentinfo();
-                ProjectRecords project = new ProjectRecords();
-                project.setId(records1.getId());
-                select.setParentIds("0,");
-                select.setProject(project);
-                List<Projectcontentinfo> p = projectcontentinfoService.findListByProject(select);
-                for (ProjectRecordTreeData reportData : reportDataList) {
-                    //添加工作内容id
-                    if(p.size()>0){
-                        reportData.setContentPId(p.get(0).getId());
-                        reportData.setParentIds("0,");
-                        reportData.setDictType("");
-                    }
-                    //将项目所属类型名称放入树形列表的projectId中
-                    reportData.setProjectId(reportData.getProjectLeader());
-                    //添加项目负责人
-                    reportData.setProjectLeader(projectLeader);
-                    //添加登陆者id
-                    reportData.setLoginId(UserUtils.getUser().getId());
-                    reportData.setCreateId(records1.getCreateBy().getId());
-                    //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
-                    for (String masterId : masterIdList) {
-                        if(masterId.equals(UserUtils.getUser().getId())){
-                            reportData.setOperationSign(1);
-                            break;
-                        }else{
-                            reportData.setOperationSign(0);
-                        }
-                    }
-                }
-            }
-            projectRecordTreeDataList.addAll(reportDataList);
-
-        }
-        map.put("data",projectRecordTreeDataList);
-        return map;
+        model.addAttribute("page",page);
+        searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
+        model.addAttribute("searchLabel",searchLabel);
+        return "modules/sys/gridselectProjectList";
     }
 }

+ 19 - 159
src/main/resources/mappings/modules/constructionContract/contractDao.xml

@@ -33,89 +33,18 @@
 		a.pay_amt AS "payAmt",
 		a.start_date AS "startDate",
 		a.end_date AS "endDate",
-		pd.name AS "program.name",
 		a.contract_name as "contractName"
 	</sql>
 
-	<sql id="workContentContractinfoJoins">
-		LEFT JOIN  project_content_data pd ON pd.id = a.program_id
-	</sql>
-
 
-	<select id="get" resultType="WorkContentContractinfo" >
+	<select id="get" resultType="com.jeeplus.modules.projectConstruction.entity.ConstructionContract" >
 		SELECT
 		<include refid="workContentContractinfoColumns"/>
-		FROM work_content_contractinfo a
-		<include refid="workContentContractinfoJoins"/>
+		FROM construction_contract a
 		WHERE a.id = #{id}
 	</select>
 
-	<!--<select id="findList" resultType="WorkContentContractinfo" >
-		SELECT
-		<include refid="workContentContractinfoColumns"/>
-		FROM work_content_contractinfo a
-		<include refid="workContentContractinfoJoins"/>
-		<where>
-			a.del_flag = #{DEL_FLAG_NORMAL}
-			<if test="projectId != null and projectId != ''">
-				AND a.project_id = #{projectId}
-			</if>
-			<if test="contentId != null and contentId != ''">
-				AND a.content_id = #{contentId}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>-->
-
-	<select id="findByConId" resultType="WorkContentContractinfo" parameterType="String">
-		SELECT
-		<include refid="workContentContractinfoColumns"/>
-		,pcd.name as 'proContentName',su.name as 'createName'
-		FROM work_content_contractinfo a
-		<include refid="workContentContractinfoJoins"/>
-		LEFT JOIN  project_content_data pcd ON pcd.id = a.content_id
-		left join sys_user su on su.id = a.create_by
-		<where>
-			content_id = #{id} and pcd.del_flag=0
-		</where>
-	</select>
-
-	<select id="findByType" resultType="WorkContentContractinfo" parameterType="String">
-		SELECT
-		a.id
-		FROM work_content_contractinfo a
-		<where>
-			a.cnumber = #{cnumber}
-		</where>
-		order by a.create_date DESC
-	</select>
-
-	<select id="findAllList" resultType="WorkContentContractinfo" >
-		SELECT
-		<include refid="workContentContractinfoColumns"/>
-		FROM work_content_contractinfo a
-		<include refid="workContentContractinfoJoins"/>
-		<where>
-			a.del_flag = #{DEL_FLAG_NORMAL}
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insertContract">
+	<insert id="insert">
 		INSERT INTO construction_contract(
 			id,
 			create_by,
@@ -230,64 +159,26 @@
 	</update>
 
 
-	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
-	<select id="findUniqueByProperty" resultType="WorkContentContractinfo" statementType="STATEMENT">
-		select * FROM work_content_contractinfo  where ${propertyName} = '${value}'
-	</select>
-
-
 
-	<select id="findList" resultType="ConstructionContract" >
+	<select id="findList" resultType="com.jeeplus.modules.projectConstruction.entity.ConstructionContract" >
 		SELECT
 		<include refid="workContentContractinfoColumns"/>
 		FROM construction_contract a
 
 		<where>
-			a.del_flag = #{DEL_FLAG_NORMAL}
-			<!--<if test="workClientLinkman != null and workClientLinkman.id != '' and workClientLinkman.id != null">-->
-			<!--LEFT JOIN work_client_linkman b ON a.id = b.client_id-->
-			<!--and b.id = #{workClientLinkman.id}-->
-			<!--</if>-->
-			<if test="name != null and name != ''">
-				AND a.name LIKE
-				<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
+			a.del_flag = 0
+			<if test="contractName != null and contractName !=''">
+				AND a.contract_name LIKE concat('%',#{contractName},'%')
 			</if>
-			<if test="companyType != null and companyType != ''">
-				AND a.company_type = #{companyType}
+			<if test="cnumber != null and cnumber != ''">
+				AND a.cnumber like concat('%',#{cnumber},'%')
 			</if>
-			<if test="companyIndustry != null and companyIndustry != ''">
-				AND a.company_industry = #{companyIndustry}
-			</if>
-			<if test="area != null and area.id != null and area.id != ''">
-				AND (a.area_id = #{area.id} OR find_in_set(#{area.id},a.area_parent_ids))
-			</if>
-			<if test="workClientLinkman != null and workClientLinkman.name != null and workClientLinkman.name !=''">
-				AND b.name LIKE concat('%',#{workClientLinkman.name},'%')
-			</if>
-			<if test="workClientLinkman != null and workClientLinkman.linkPhone != null and workClientLinkman.linkPhone !=''">
-				AND b.link_phone LIKE concat('%',#{workClientLinkman.linkPhone},'%')
-			</if>
-			<if test="address != null and address != ''">
-				AND a.address LIKE
-				<if test="dbName == 'oracle'">'%'||#{address}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{address}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{address},'%')</if>
-			</if>
-			<if test="clientType != null and clientType != ''">
-				AND a.client_type like concat('%',#{clientType},'%')
-			</if>
-			<if test="uscCode != null and uscCode != ''">
-				AND a.usc_code like concat('%',#{uscCode},'%')
-			</if>
-			<if test="beginDate !=null">
-				AND a.create_date >= #{beginDate}
+			<if test="startDate !=null">
+				AND a.create_date >= #{startDate}
 			</if>
 			<if test="endDate !=null">
 				AND a.create_date &lt; #{endDate}
 			</if>
-			AND a.company_id = #{currentUser.company.id}
 		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -302,52 +193,21 @@
 	<select id="queryCount" resultType="int" >
 		SELECT
 		count(1)
-		FROM work_client_info a
-		<if test="workClientLinkman != null and workClientLinkman.name !=null and workClientLinkman.name !=''">
-			LEFT JOIN work_client_linkman b ON a.id = b.client_id
-		</if>
+		FROM construction_contract a
 		<where>
-			a.del_flag = #{DEL_FLAG_NORMAL}
-			<if test="name != null and name != ''">
-				AND a.name LIKE
-				<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="companyType != null and companyType != ''">
-				AND a.company_type = #{companyType}
-			</if>
-			<if test="companyIndustry != null and companyIndustry != ''">
-				AND a.company_industry = #{companyIndustry}
-			</if>
-			<if test="area != null and area.id != null and area.id != ''">
-				AND (a.area_id = #{area.id} OR find_in_set(#{area.id},a.area_parent_ids))
-			</if>
-			<if test="workClientLinkman != null and workClientLinkman.name != null and workClientLinkman.name !=''">
-				AND b.name LIKE concat('%',#{workClientLinkman.name},'%')
-			</if>
-			<if test="workClientLinkman != null and workClientLinkman.linkPhone != null and workClientLinkman.linkPhone !=''">
-				AND b.link_phone LIKE concat('%',#{workClientLinkman.linkPhone},'%')
-			</if>
-			<if test="address != null and address != ''">
-				AND a.address LIKE
-				<if test="dbName == 'oracle'">'%'||#{address}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{address}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{address},'%')</if>
-			</if>
-			<if test="clientType != null and clientType != ''">
-				AND a.client_type like concat('%',#{clientType},'%')
+			a.del_flag = 0
+			<if test="contractName != null and contractName !=''">
+				AND a.contract_name LIKE concat('%',#{contractName},'%')
 			</if>
-			<if test="uscCode != null and uscCode != ''">
-				AND a.usc_code like concat('%',#{uscCode},'%')
+			<if test="cnumber != null and cnumber != ''">
+				AND a.cnumber like concat('%',#{cnumber},'%')
 			</if>
-			<if test="beginDate !=null">
-				AND a.create_date >= #{beginDate}
+			<if test="startDate !=null">
+				AND a.create_date >= #{startDate}
 			</if>
 			<if test="endDate !=null">
 				AND a.create_date &lt; #{endDate}
 			</if>
-			AND a.company_id = #{currentUser.company.id}
 		</where>
 	</select>
 </mapper>

+ 9 - 27
src/main/webapp/webpage/modules/projectConstruction/projectConstructionForm.jsp

@@ -30,27 +30,8 @@
         var isMasterClient = true;//是否是主委托方
         var clientCount = 0;
         function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
-            if(validateForm.form()){
-                // if($(".trIdAdds").length==0){
-                //     top.layer.alert('请至少上传一个项目计划表或者实施方案文档!', {icon: 0});
-                //     return;
-                // }
-                if($("#workClientLinkmanList tr").length==0){
-                    top.layer.alert('请至少选择一个委托方联系人!', {icon: 0});
-                    return;
-                }
-                /*if($("#workConstructionLinkmanList tr").length==0){
-                    top.layer.alert('请至少选择一个施工方联系人!', {icon: 0});
-                    return;
-                }*/
-                if(i==2){
-                    $("#inputForm").attr("action","${ctx}/project/projectRecords/tstore");
-                }
-                $("#inputForm").submit();
-                return true;
-            }
-
-            return false;
+            $("#inputForm").submit();
+            return true;
         }
         $(document).ready(function() {
             var radioVal ;
@@ -1053,14 +1034,15 @@
 <div class="single-form">
     <div class="container">
         <sys:message content="${message}"/>
-        <form:form id="subForm" modelAttribute="constructionContract" action="#" method="post" class="form-horizontal">
+        <form:form id="inputForm" modelAttribute="constructionContract" action="${ctx}/project/constructionContract/save" method="post" class="form-horizontal">
             <form:hidden path="id"/>
+            <input type="hidden" id="programIdId" name="projectId" value="">
         <div class="form-group layui-row first">
                 <div class="form-group-label"><h2>合同信息</h2></div>
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label"><span class="require-item">*</span>项目名称:</label>
                     <div class="layui-input-block with-icon">
-                        <sys:gridselectProjcontent url="${ctx}/projectcontentinfo/projectContentData/selectcontent" id="programId" name="program.id"  value="${constructionContract.program.id}"  title="选择项目名称" labelName="program.name"
+                        <sys:gridselectProjcontent url="${ctx}/project/constructionContract/selectcontent" id="programId" name="program.id"  value="${constructionContract.program.id}"  title="选择项目名称" labelName="program.name"
                                                    labelValue="${constructionContract.program.name}" cssClass="form-control layui-input required" projectId="${constructionContract.projectId}" type="31" fieldLabels="" fieldKeys="" searchLabel="${fns:urlEncode('项目名称')}" searchKey="" ></sys:gridselectProjcontent>
                     </div>
                 </div>
@@ -1131,13 +1113,13 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label ">目标成本(元):</label>
                     <div class="layui-input-block">
-                        <input name="titularAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.titularAmt}" pattern="#,##0.00#"/>" onchange="formatNum(this);"  class="form-control layui-input number"/>
+                        <input name="titularAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.titularAmt}" pattern="#,##0.00#"/>" class="form-control layui-input number"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label double-line"><span class="require-item">*</span>有效合同金额(元):</label>
                     <div class="layui-input-block">
-                        <input name="trueAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.trueAmt}" pattern="#,##0.00#"/>" onchange="formatNum(this);"  class="form-control layui-input number required"/>
+                        <input name="trueAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.trueAmt}" pattern="#,##0.00#"/>" class="form-control layui-input number required"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
@@ -1169,7 +1151,7 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label">止付金额:</label>
                     <div class="layui-input-block">
-                        <input name="stopAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.stopAmt}" pattern="#,##0.00#"/>" onchange="formatNum(this);"  class="form-control layui-input  number"/>
+                        <input name="stopAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.stopAmt}" pattern="#,##0.00#"/>"  class="form-control layui-input  number"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
@@ -1193,7 +1175,7 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label"><span class="require-item">*</span>支付金额:</label>
                     <div class="layui-input-block">
-                        <input name="payAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.payAmt}" pattern="#,##0.00#"/>" onchange="formatNum(this);"  class="form-control layui-input required number"/>
+                        <input name="payAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.payAmt}" pattern="#,##0.00#"/>" class="form-control layui-input required number"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">

+ 18 - 79
src/main/webapp/webpage/modules/projectConstruction/projectConstructionList.jsp

@@ -21,7 +21,7 @@
 				}
 			});
 			laydate.render({
-				elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
 				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
 				type : 'date'
 			});
@@ -78,24 +78,16 @@
 	<div class="layui-row">
 		<div class="full-width fl">
 			<div class="contentShadow layui-row" id="queryDiv">
-				<form:form id="searchForm" modelAttribute="workClientInfo" action="${ctx}/workclientinfo/workClientInfo/list" method="post" class="form-inline">
+				<form:form id="searchForm" modelAttribute="constructionContract" action="${ctx}/project/constructionContract/list" method="post" class="form-inline">
 					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
 					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
-					<%--<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->--%>
 					<div class="commonQuery lw14">
 						<div class="layui-item query athird">
 							<label class="layui-form-label">合同名称:</label>
 							<div class="layui-input-block">
-								<form:input path="name" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+								<form:input path="contractName" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
 							</div>
 						</div>
-						<%--<div class="layui-item query athird">
-							<label class="layui-form-label">地区:</label>
-							<div class="layui-input-block with-icon">
-								<sys:treeselect id="area" name="area.id" value="${workClientInfo.area.id}" labelName="area.name" labelValue="${workClientInfo.area.name}"
-												title="区域" url="/sys/area/treeData" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false"/>
-							</div>
-						</div>--%>
 
 						<div class="layui-item athird">
 							<div class="input-group">
@@ -110,49 +102,15 @@
 						<div class="layui-item query athird">
 							<label class="layui-form-label">创建时间:</label>
 							<div class="layui-input-block">
-								<input id="beginDate" placeholder="开始时间" name="beginDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
-									   value="<fmt:formatDate value="${workClientInfo.beginDate}" pattern="yyyy-MM-dd"/>"/>
+								<input id="startDate" placeholder="开始时间" name="startDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+									   value="<fmt:formatDate value="${constructionContract.startDate}" pattern="yyyy-MM-dd"/>"/>
 								</input>
 								<span class="group-sep">-</span>
 								<input id="endDate" placeholder="结束时间" name="endDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
-									   value="<fmt:formatDate value="${workClientInfo.endDate}" pattern="yyyy-MM-dd"/>"/>
+									   value="<fmt:formatDate value="${constructionContract.endDate}" pattern="yyyy-MM-dd"/>"/>
 								</input>
 							</div>
 						</div>
-
-						<div class="layui-item query athird">
-							<label class="layui-form-label">客户性质:</label>
-							<div class="layui-input-block">
-								<form:select path="companyType"  class="form-control simple-select">
-									<form:option value="" label=""/>
-									<form:options items="${fns:getMainDictList('company_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
-								</form:select>
-							</div>
-						</div>
-						<div class="layui-item query athird">
-							<label class="layui-form-label">客户行业:</label>
-							<div class="layui-input-block">
-								<form:select path="companyIndustry" class="form-control layui-input">
-									<form:option value="" label=""/>
-									<form:options items="${fns:getMainDictList('company_industry')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
-								</form:select>
-							</div>
-						</div>
-						<div class="layui-item query athird">
-							<label class="layui-form-label">客户类型:</label>
-							<div class="layui-input-block">
-								<form:select path="clientType" class="form-control layui-input">
-									<form:option value="" label=""/>
-									<form:options items="${fns:getMainDictList('client_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
-								</form:select>
-							</div>
-						</div>
-						<div class="layui-item query athird">
-							<label class="layui-form-label">统一社会信用代码:</label>
-							<div class="layui-input-block">
-								<form:input path="uscCode" htmlEscape="false"  class="form-control layui-input"/>
-							</div>
-						</div>
 					</div>
 				</form:form>
 			</div>
@@ -163,15 +121,13 @@
 				<div class="nav-btns">
 					<%--此处按钮样式包括 nav-btn-add nav-btn-refresh nav-btn-import nav-btn-export nav-btn-query nav-btn-reset--%>
 						<table:addRow url="${ctx}/project/constructionContract/form" title="合同管理"></table:addRow><!-- 增加按钮 -->
-					<shiro:hasPermission name="workclientinfo:workClientInfo:import">
+					<%--<shiro:hasPermission name="project:constructionContract:import">
 						<table:importExcel url="${ctx}/workclientinfo/workClientInfo/import"></table:importExcel><!-- 导入按钮 -->
 					</shiro:hasPermission>
 
-					<shiro:hasPermission name="workclientinfo:workClientInfo:export">
+					<shiro:hasPermission name="project:constructionContract:export">
 						<table:exportExcel url="${ctx}/workclientinfo/workClientInfo/export"></table:exportExcel><!-- 导出按钮 -->
-					</shiro:hasPermission>
-
-					<table:importInfoErr url="${ctx}/workclientinfo/workClientInfo/importInfoErr" title="导入日志"></table:importInfoErr><!-- 导出按钮 -->
+					</shiro:hasPermission>--%>
 
 					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
 					<div style="clear: both;"></div>
@@ -195,21 +151,11 @@
 			,page: false
 			,cols: [[
 				{field:'index',align:'center', title: '序号',width:40}
-				,{field:'clientName',align:'center', title: '客户名称',minWidth:200,templet:function(d){
+				,{field:'contractName',align:'center', title: '合同名称',minWidth:200,templet:function(d){
 						var xml = "<a class=\"attention-info\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看客户信息', '${ctx}/workclientinfo/workClientInfo/detail?id=" + d.id + "&wlId=" + d.linkman + "','95%','95%')\">" +
-								"<span title=" + d.clientName + ">" + d.clientName.substr(0,40) + "</span></a>";
+								"<span title=" + d.contractName + ">" + d.contractName.substr(0,40) + "</span></a>";
 						return xml;
 					}}
-				,{field:'number',align:'center', title: '客户编号',width:150}
-				,{field:'clientProperty',align:'center', title: '客户性质',width:150}
-				,{field:'trade',align:'center', title: '客户行业', width:150}
-				,{field:'area', align:'center',title: '所在地区',width:200}
-				,{field:'clientType', align:'center',title: '客户类型',minWidth:200,templet:function(d){
-						return "<span title='"+ d.clientType +"'>" + d.clientType + "</span>";
-					}}
-				,{field:'code', align:'center',title: '统一社会信用代码',minWidth:250,templet:function(d){
-						return "<span title='"+ d.code +"'>" + d.code + "</span>";
-					}}
 				,{field:'createDate',align:'center', title: '创建时间', width:85}
 				,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
 						////对操作进行初始化
@@ -225,23 +171,16 @@
 			]]
 			,data: [
 				<c:if test="${ not empty page.list}">
-				<c:forEach items="${page.list}" var="workClientInfo" varStatus="index">
+				<c:forEach items="${page.list}" var="constructionContract" varStatus="index">
 				<c:if test="${index.index != 0}">,</c:if>
 				{
 					"index":"${index.index+1}"
-					,"id":"${workClientInfo.id}"
-					,"number":"${workClientInfo.number}"
-					,"linkman":"${workClientInfo.workClientLinkman.id}"
-					,"clientName":"${workClientInfo.name}"
-					,"clientProperty":"${fns:getMainDictLabel(workClientInfo.companyType, 'company_type', '')}"
-					,"trade":"${fns:getMainDictLabel(workClientInfo.companyIndustry, 'company_industry', '')}"
-					,"area":"${workClientInfo.area.name}"
-					,"clientType":"${fns:getMainDictLabels(workClientInfo.clientType,',','client_type', '')}"
-					,"code":"${workClientInfo.uscCode}"
-					,"createDate":"<fmt:formatDate value="${workClientInfo.createDate}" pattern="yyyy-MM-dd"/>"
-					<c:if test="${flag == '1' or fns:getUser().id == workClientInfo.createBy.id}">
-					<shiro:hasPermission name="workclientinfo:workClientInfo:edit">,"canedit":"1"</shiro:hasPermission>
-					<shiro:hasPermission name="workclientinfo:workClientInfo:del">,"candelete":"1"</shiro:hasPermission>
+					,"id":"${constructionContract.id}"
+					,"contractName":"${constructionContract.contractName}"
+					,"createDate":"<fmt:formatDate value="${constructionContract.createDate}" pattern="yyyy-MM-dd"/>"
+					<c:if test="${flag == '1' or fns:getUser().id == constructionContract.createBy.id}">
+					<shiro:hasPermission name="project:constructionContract:edit">,"canedit":"1"</shiro:hasPermission>
+					<shiro:hasPermission name="project:constructionContract:del">,"candelete":"1"</shiro:hasPermission>
 					</c:if>
 				}
 				</c:forEach>