Selaa lähdekoodia

投标管理代码开发

user5 5 vuotta sitten
vanhempi
commit
8b3fcad07c

+ 27 - 0
src/main/java/com/jeeplus/modules/biddingManagement/dao/BiddingManagementDao.java

@@ -0,0 +1,27 @@
+package com.jeeplus.modules.biddingManagement.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.biddingManagement.entity.BiddingManagementInfo;
+import com.jeeplus.modules.projectAssess.entity.ProjectAssessInfo;
+
+/**
+ * 投标管理Dao
+ * @author 徐滕
+ * @version 2020-05-12
+ */
+@MyBatisDao
+public interface BiddingManagementDao extends CrudDao<BiddingManagementInfo> {
+    /**
+     * 根据条件查询项目评估list数量
+     * @param biddingManagementInfo
+     * @return
+     */
+    int queryCount(BiddingManagementInfo biddingManagementInfo);
+
+    /**
+     * 查询数据量
+     * @return
+     */
+    int findByBiddingManagerment();
+}

+ 145 - 0
src/main/java/com/jeeplus/modules/biddingManagement/entity/BiddingManagementInfo.java

@@ -0,0 +1,145 @@
+package com.jeeplus.modules.biddingManagement.entity;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 投标管理entity
+ * @author 徐滕
+ * @version 2020-05-12
+ */
+public class BiddingManagementInfo extends DataEntity<BiddingManagementInfo> {
+    public static final String SERIAL_BIZCODE ="138";
+    private String proiectAssessId;//评估信息id
+    private String tenderSite;//投标地点
+    private Date tenderTime;//投标时间
+    private String tenderStatus;//投标状态
+    private String biddingId;//投标记录编号
+    private String ext;//投标类型
+
+    private String assessNum;//评估信息编号
+    private String projectId;//项目id
+    private String projectName;//投标项目名称
+    private Date beginDate;
+    private Date endDate;
+    private Office company;
+    private Office office;
+    private List<WorkClientAttachment> workAttachments = Lists.newArrayList();
+
+    public String getExt() {
+        return ext;
+    }
+
+    public void setExt(String ext) {
+        this.ext = ext;
+    }
+
+    public String getBiddingId() {
+        return biddingId;
+    }
+
+    public void setBiddingId(String biddingId) {
+        this.biddingId = biddingId;
+    }
+
+    public Office getCompany() {
+        return company;
+    }
+
+    public void setCompany(Office company) {
+        this.company = company;
+    }
+
+    public Office getOffice() {
+        return office;
+    }
+
+    public void setOffice(Office office) {
+        this.office = office;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getAssessNum() {
+        return assessNum;
+    }
+
+    public void setAssessNum(String assessNum) {
+        this.assessNum = assessNum;
+    }
+
+    public String getProiectAssessId() {
+        return proiectAssessId;
+    }
+
+    public void setProiectAssessId(String proiectAssessId) {
+        this.proiectAssessId = proiectAssessId;
+    }
+
+    public String getTenderSite() {
+        return tenderSite;
+    }
+
+    public void setTenderSite(String tenderSite) {
+        this.tenderSite = tenderSite;
+    }
+
+    public Date getTenderTime() {
+        return tenderTime;
+    }
+
+    public void setTenderTime(Date tenderTime) {
+        this.tenderTime = tenderTime;
+    }
+
+    public String getTenderStatus() {
+        return tenderStatus;
+    }
+
+    public void setTenderStatus(String tenderStatus) {
+        this.tenderStatus = tenderStatus;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public Date getBeginDate() {
+        return beginDate;
+    }
+
+    public void setBeginDate(Date beginDate) {
+        this.beginDate = beginDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+    public List<WorkClientAttachment> getWorkAttachments() {
+        return workAttachments;
+    }
+
+    public void setWorkAttachments(List<WorkClientAttachment> workAttachments) {
+        this.workAttachments = workAttachments;
+    }
+
+}

+ 135 - 0
src/main/java/com/jeeplus/modules/biddingManagement/service/BiddingManagementService.java

@@ -0,0 +1,135 @@
+package com.jeeplus.modules.biddingManagement.service;
+
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.IdGen;
+import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.modules.biddingManagement.dao.BiddingManagementDao;
+import com.jeeplus.modules.biddingManagement.entity.BiddingManagementInfo;
+import com.jeeplus.modules.projectAssess.entity.ProjectAssessInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.serialnum.service.SerialNumTplService;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workgooutapply.entity.WorkGoOutInfo;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 投标管理Service
+ * @author 徐滕
+ * @version 2020-05-12
+ */
+@Service
+@Transactional(readOnly = true)
+public class BiddingManagementService extends CrudService<BiddingManagementDao, BiddingManagementInfo> {
+
+    @Autowired
+    private WorkClientAttachmentDao workClientAttachmentDao;
+    @Autowired
+    private SerialNumTplService serialNumTplService;
+
+    public BiddingManagementInfo get(String id) {
+        return super.get(id);
+    }
+
+    public Page<BiddingManagementInfo> findPage(Page<BiddingManagementInfo> page, BiddingManagementInfo biddingManagementInfo) {
+        //设置数据权限
+        if(!UserUtils.getUser().isAdmin()) {
+            String dataScopeSql = dataScopeFilterOR(biddingManagementInfo.getCurrentUser(), "o", "u", "s", MenuStatusEnum.WORK_CLIENT_INFO.getValue());
+            biddingManagementInfo.getSqlMap().put("dsf", dataScopeSql);
+        }
+        int count = dao.queryCount(biddingManagementInfo);
+        page.setCount(count);
+        page.setCountFlag(false);
+        biddingManagementInfo.setPage(page);
+        List<BiddingManagementInfo> biddingManagementList = findList(biddingManagementInfo);
+        page.setList(biddingManagementList);
+        return page;
+    }
+
+
+    @Transactional(readOnly = false)
+    public void saveBiddingManagementInfo(BiddingManagementInfo biddingManagementInfo) {
+        if (StringUtils.isNotBlank(biddingManagementInfo.getId())){
+            Office company= new Office();
+            Office office =  new Office();
+            company.setId(UserUtils.getUser().getCompany().getId());
+            office.setId(UserUtils.getUser().getOffice().getId());
+            biddingManagementInfo.setCompany(company);
+            biddingManagementInfo.setOffice(office);
+        }
+        User createBy = biddingManagementInfo.getCreateBy();
+        if(createBy != null){
+            createBy = UserUtils.get(createBy.getId());
+        }else {
+            createBy = UserUtils.getUser();
+        }
+        if (com.jeeplus.common.utils.StringUtils.isBlank(biddingManagementInfo.getBiddingId())){
+            String biddingId = serialNumTplService.genSerialNum(UserUtils.getUser().getCompany(), BiddingManagementInfo.SERIAL_BIZCODE);
+            biddingManagementInfo.setBiddingId(biddingId);
+        }
+        biddingManagementInfo.setCreateBy(createBy);
+        biddingManagementInfo.setCreateDate(new Date());
+        biddingManagementInfo.setUpdateBy(createBy);
+        biddingManagementInfo.setUpdateDate(new Date());
+        if(StringUtils.isBlank(biddingManagementInfo.getId())){
+            biddingManagementInfo.setId(IdGen.uuid());
+            dao.insert(biddingManagementInfo);
+        }else {
+            super.save(biddingManagementInfo);
+        }
+        //保存项目计划附件信息
+        this.saveAttachments(biddingManagementInfo);
+    }
+
+
+    private void saveAttachments(BiddingManagementInfo biddingManagementInfo) {
+        if (biddingManagementInfo.getWorkAttachments()!=null && !biddingManagementInfo.getWorkAttachments().isEmpty()) {
+            //保存附件信息
+            for (WorkClientAttachment workClientAttachment : biddingManagementInfo.getWorkAttachments()) {
+                if (StringUtils.isBlank(workClientAttachment.getId())&&StringUtils.isNotBlank(workClientAttachment.getAttachmentId())) {
+                    continue;
+                }
+                if (StringUtils.isBlank(workClientAttachment.getId())&&StringUtils.isBlank(workClientAttachment.getUrl())) {
+                    continue;
+                }
+                if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workClientAttachment.getDelFlag())) {
+                    workClientAttachment.setAttachmentId(biddingManagementInfo.getId());
+                    workClientAttachment.setAttachmentFlag("138");
+                    workClientAttachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workClientAttachment.getId()) || "null".equals(workClientAttachment.getId())) {
+                        workClientAttachment.preInsert();
+                        workClientAttachmentDao.insert(workClientAttachment);
+                    } else {
+                        workClientAttachment.preUpdate();
+                        workClientAttachmentDao.update(workClientAttachment);
+                    }
+                } else {
+                    workClientAttachmentDao.delete(workClientAttachment);
+                }
+            }
+        }
+    }
+
+    public void queryWorkAttachment(BiddingManagementInfo biddingManagementInfo) {
+        WorkClientAttachment attchment = new WorkClientAttachment();
+        attchment.setAttachmentId(biddingManagementInfo.getId());
+        List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
+        biddingManagementInfo.setWorkAttachments(attachments);
+    }
+
+    @Transactional(readOnly = false)
+    public void delete(BiddingManagementInfo biddingManagementInfo) {
+        dao.delete(biddingManagementInfo);
+    }
+}

+ 184 - 0
src/main/java/com/jeeplus/modules/biddingManagement/web/BiddingManagementController.java

@@ -0,0 +1,184 @@
+package com.jeeplus.modules.biddingManagement.web;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.biddingManagement.entity.BiddingManagementInfo;
+import com.jeeplus.modules.biddingManagement.service.BiddingManagementService;
+import com.jeeplus.modules.projectAssess.entity.ProjectAssessInfo;
+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.sys.utils.UserUtils;
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Date;
+
+/**
+ * 投标管理Controller
+ * @author 徐滕
+ * @version 2020-05-12
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/management/biddingManagement")
+public class BiddingManagementController extends BaseController {
+
+    @Autowired
+    private BiddingManagementService biddingManagementService;
+    @Autowired
+    protected ProjectRecordsService projectRecordsService;
+
+    @ModelAttribute
+    public BiddingManagementInfo get(@RequestParam(required=false) String id) {
+        BiddingManagementInfo entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = biddingManagementService.get(id);
+        }
+        if (entity == null){
+            entity = new BiddingManagementInfo();
+        }
+        return entity;
+    }
+
+    /**
+     * 查询项目评估信息
+     * @param biddingManagementInfo
+     * @param request
+     * @param response
+     * @param model
+     * @return
+     */
+    @RequiresPermissions("management:biddingManagement:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(BiddingManagementInfo biddingManagementInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        Page<BiddingManagementInfo> page = biddingManagementService.findPage(new Page<BiddingManagementInfo>(request, response), biddingManagementInfo);
+        model.addAttribute("page", page);
+        model.addAttribute("projectName",biddingManagementInfo.getProjectName());
+        model.addAttribute("tenderStatus",biddingManagementInfo.getTenderStatus());
+        model.addAttribute("beginDate",biddingManagementInfo.getBeginDate());
+        model.addAttribute("endDate",biddingManagementInfo.getEndDate());
+        return "modules/biddingManagement/biddingManagementList";
+    }
+
+    /**
+     * 查看,增加,编辑开票管理表单页面
+     */
+    @RequiresPermissions(value={"management:biddingManagement:add","management:biddingManagement:edit"},logical= Logical.OR)
+    @RequestMapping(value = "form")
+    public String form(BiddingManagementInfo biddingManagementInfo, Model model) {
+        if (biddingManagementInfo != null && StringUtils.isNotBlank(biddingManagementInfo.getId())) {
+            biddingManagementInfo = biddingManagementService.get(biddingManagementInfo.getId());
+            biddingManagementService.queryWorkAttachment(biddingManagementInfo);
+        }else {
+            biddingManagementInfo.setCreateBy(UserUtils.getUser());
+            biddingManagementInfo.setCreateDate(new Date());
+        }
+        model.addAttribute("biddingManagement", biddingManagementInfo);
+        return "modules/biddingManagement/biddingManagementForm";
+    }
+
+    /**
+     * 查看,增加,编辑开票管理表单页面
+     */
+    @RequiresPermissions(value={"management:biddingManagement:view"},logical= Logical.OR)
+    @RequestMapping(value = "view")
+    public String view(BiddingManagementInfo biddingManagementInfo, Model model) {
+        if (biddingManagementInfo != null && StringUtils.isNotBlank(biddingManagementInfo.getId())) {
+            biddingManagementInfo = biddingManagementService.get(biddingManagementInfo.getId());
+            biddingManagementService.queryWorkAttachment(biddingManagementInfo);
+        }else {
+            biddingManagementInfo.setCreateBy(UserUtils.getUser());
+            biddingManagementInfo.setCreateDate(new Date());
+        }
+        model.addAttribute("biddingManagement", biddingManagementInfo);
+        return "modules/biddingManagement/biddingManagementView";
+    }
+
+
+
+    /**
+     * 选择开票项目
+     */
+    @RequestMapping(value = "selectProject")
+    public String selectproject(ProjectRecords project, String url, String fieldLabels, String fieldKeys, String searchLabel, String searchKey, String ids, HttpServletRequest request, HttpServletResponse response, Model model) {
+        project.setCompany(UserUtils.getSelectCompany());
+        project.setProjectStatus(ProjectStatusEnum.SIGNED.getValue());//已签状态
+        project.setLeaderNameStr(UserUtils.getUser().getName());
+        Page<ProjectRecords> page = projectRecordsService.findPageByBiddingManagement(new Page<ProjectRecords>(request, response), project);
+        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();
+        }
+        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);
+        model.addAttribute("obj", project);
+        model.addAttribute("page",page);
+        return "modules/sys/gridinvoiceproject";
+    }
+
+    /**
+     * 保存项目
+     */
+    @RequiresPermissions(value={"management:biddingManagement:add","management:biddingManagement:edit"},logical=Logical.OR)
+    @RequestMapping(value = "save")
+    public String tStore(BiddingManagementInfo biddingManagementInfo, Model model, RedirectAttributes redirectAttributes) throws Exception{
+        if (!beanValidator(model, biddingManagementInfo)){
+            return form(biddingManagementInfo, model);
+        }
+        if (StringUtils.isNotBlank(biddingManagementInfo.getProjectId())){
+            biddingManagementInfo.setProjectName(projectRecordsService.get(biddingManagementInfo.getProjectId()).getProjectName());
+        }
+        try {
+            if (!biddingManagementInfo.getIsNewRecord()) {//编辑表单保存
+                BiddingManagementInfo t = biddingManagementService.get(biddingManagementInfo.getId());//从数据库取出记录的值
+                MyBeanUtils.copyBeanNotNull2Bean(biddingManagementInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                biddingManagementService.saveBiddingManagementInfo(t);//保存
+            } else {//新增表单保存
+                biddingManagementService.saveBiddingManagementInfo(biddingManagementInfo);//保存
+            }
+            addMessage(redirectAttributes, "保存投标信息成功");
+        }catch (Exception e){
+            logger.error("保存投标信息异常:",e);
+            addMessage(redirectAttributes, "保存投标信息异常:"+e.getMessage());
+        }
+        return "redirect:"+ Global.getAdminPath()+"/management/biddingManagement/?repage";
+    }
+
+    /**
+     * 删除项目
+     */
+    @RequiresPermissions("management:biddingManagement:del")
+    @RequestMapping(value = "delete")
+    public String delete(BiddingManagementInfo biddingManagementInfo, RedirectAttributes redirectAttributes) {
+        biddingManagementService.delete(biddingManagementInfo);
+        addMessage(redirectAttributes, "删除项目评估成功");
+        return "redirect:"+Global.getAdminPath()+"/management/biddingManagement/?repage";
+    }
+
+}

+ 0 - 1
src/main/java/com/jeeplus/modules/projectAssess/service/ProjectAssessService.java

@@ -138,7 +138,6 @@ public class ProjectAssessService extends CrudService<ProjectAssessDao, ProjectA
         projectAssessInfo.setCompany(company);
         projectAssessInfo.setOffice(office);
 
-        Integer oldStatus = projectAssessInfo.getStatus();
         projectAssessInfo.setStatus(status.getValue());
         User createBy = projectAssessInfo.getCreateBy();
         if(createBy != null){

+ 2 - 0
src/main/java/com/jeeplus/modules/projectrecord/dao/ProjectRecordsDao.java

@@ -31,6 +31,8 @@ public interface ProjectRecordsDao extends CrudDao<ProjectRecords> {
     ProjectRecords findUseableByProjectId(String projectId);
     List<ProjectRecords> findPageByRe(ProjectRecords records);
     int queryCount(ProjectRecords records);
+    int queryCountByBiddingManagement(ProjectRecords records);
+    List<ProjectRecords> findListByBiddingManagement(ProjectRecords records);
     int queryCountByStatus(ProjectRecords records);
     int findByContract(String contractId);
 

+ 24 - 0
src/main/java/com/jeeplus/modules/projectrecord/service/ProjectRecordsService.java

@@ -197,6 +197,30 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 		return page;
 	}
 
+	public Page<ProjectRecords> findPageByBiddingManagement(Page<ProjectRecords> page, ProjectRecords projectRecords) {
+		//设置数据权限
+		if(!UserUtils.getUser().isAdmin()) {
+			String dataScopeSql = dataScopeFilterOR(projectRecords.getCurrentUser(), "o", "u", "s", MenuStatusEnum.WORK_RECORDS.getValue());
+			projectRecords.getSqlMap().put("dsf", dataScopeSql);
+		}
+		int count = dao.queryCountByBiddingManagement(projectRecords);
+		page.setCount(count);
+		page.setCountFlag(false);
+		projectRecords.setPage(page);
+		List<ProjectRecords> recordsList = dao.findListByBiddingManagement(projectRecords);
+		//查询负责人信息
+		for (ProjectRecords records : recordsList) {
+			this.queryContractInfos(records);
+			List<User> users = workProjectUserDao.queryProjectUsers(records.getId(), "1");
+			records.setProjectLeaders(users);
+			records.setLeaderNameStr(Collections3.extractToString(users, "name", ","));
+			records.setLeaderIds(Collections3.extractToString(users, "id", ","));
+			records.setCompany(dao.selectCompany(records.getCompany().getId()));
+		}
+		page.setList(recordsList);
+		return page;
+	}
+
 	/**
 	 * 根据id 查询公司信息
 	 * @param id

+ 182 - 0
src/main/resources/mappings/modules/biddingManagement/BiddingManagementDao.xml

@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.modules.biddingManagement.dao.BiddingManagementDao">
+
+	<!-- 项目评估表信息 -->
+	<sql id="biddingManagementColumns">
+		a.id as id,
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.project_name as projectName,
+		a.project_id as projectId,
+		a.bidding_id as biddingId,
+		a.remarks as remakes,
+		a.del_flag as delFlag,
+		a.proiect_assess_id as proiectAssessId,
+		a.tender_site as tenderSite,
+		a.tender_time as tenderTime,
+		a.tender_status as tenderStatus,
+		a.ext as ext
+	</sql>
+
+	<!-- 根据id查询项目评估信息 -->
+	<select id="get" resultType="com.jeeplus.modules.biddingManagement.entity.BiddingManagementInfo" >
+		SELECT
+			<include refid="biddingManagementColumns"/>
+		,pai.num as assessNum
+		FROM bidding_management_info a
+		left join project_assess_info pai on pai.id = a.proiect_assess_id
+		WHERE a.id = #{id}
+	</select>
+
+	<!-- 根据条件查询项目评估list信息 -->
+	<select id="findList" resultType="com.jeeplus.modules.biddingManagement.entity.BiddingManagementInfo" >
+		SELECT
+		<include refid="biddingManagementColumns"/>
+		,pai.num as assessNum
+		FROM bidding_management_info a
+		left join project_assess_info pai on pai.id = a.proiect_assess_id
+		<where>
+            a.del_flag = 0
+			<if test="projectName != null and projectName != ''">
+				AND a.project_name like concat('%',#{projectName},'%')
+			</if>
+			<if test="tenderStatus != null and tenderStatus != ''">
+				AND a.tender_status = #{tenderStatus}
+			</if>
+
+			<if test="beginDate !=null">
+				AND a.create_date >= #{beginDate}
+			</if>
+			<if test="endDate !=null">
+				AND a.create_date &lt; #{endDate}
+			</if>
+		</where>
+		GROUP BY a.id
+		<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>
+
+	<!-- 根据条件查询项目评估list数量 -->
+	<select id="queryCount" resultType="int" >
+		SELECT count(DISTINCT a.id)
+		FROM bidding_management_info a
+		left join project_assess_info pai on pai.id = a.proiect_assess_id
+		<where>
+            a.del_flag = 0
+			<if test="projectName != null and projectName != ''">
+				AND a.project_name like concat('%',#{projectName},'%')
+			</if>
+			<if test="tenderStatus != null and tenderStatus != ''">
+				AND a.tender_status = #{tenderStatus}
+			</if>
+
+			<if test="beginDate !=null">
+				AND a.create_date >= #{beginDate}
+			</if>
+			<if test="endDate !=null">
+				AND a.create_date &lt; #{endDate}
+			</if>
+		</where>
+	</select>
+
+	<select id="findByBiddingManagerment" resultType="int">
+		SELECT count(DISTINCT a.id)
+		FROM bidding_management_info a
+	</select>
+
+	<!-- 添加信息 -->
+	<insert id="insert">
+		insert into bidding_management_info (
+		  id,
+		  company_id,
+		  office_id,
+		  project_id,
+		  create_by,
+		  create_date,
+		  update_by,
+		  update_date,
+		  remarks,
+		  del_flag,
+		  project_name,
+		  bidding_id,
+		  proiect_assess_id,
+		  tender_site,
+		  tender_time,
+		  tender_status,
+		  ext
+		)
+		values
+		  (
+		  	#{id},
+		  	#{company.id},
+		  	#{office.id},
+		  	#{projectId},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+		  	#{remarks},
+		  	#{delFlag},
+		  	#{projectName},
+		  	#{biddingId},
+		  	#{proiectAssessId},
+		  	#{tenderSite},
+		  	#{tenderTime},
+		  	#{tenderStatus},
+		  	#{ext}
+		  )
+	</insert>
+
+	<update id="update">
+		update
+		bidding_management_info
+		set
+			update_by = #{updateBy.id}
+			,update_date = #{updateDate}
+			<if test="projectId!=null and projectId!=''">
+				,project_id = #{projectId}
+			</if>
+			<if test="ext!=null and ext!=''">
+				,ext = #{ext}
+			</if>
+			<if test="remarks!=null and remarks!=''">
+				,remarks = #{remarks}
+			</if>
+			<if test="delFlag!=null and delFlag!=''">
+				,del_flag = #{delFlag}
+			</if>
+			<if test="projectName!=null and projectName!=''">
+				,project_name = #{projectName}
+			</if>
+			<if test="proiectAssessId!=null and proiectAssessId!=''">
+				,proiect_assess_id = #{proiectAssessId}
+			</if>
+			<if test="tenderSite!=null and tenderSite!=''">
+				,tender_site = #{tenderSite}
+			</if>
+			<if test="tenderTime!=null and tenderTime!=''">
+				,tender_time = #{tenderTime}
+			</if>
+			<if test="tenderStatus!=null and tenderStatus!=''">
+				,tender_status = #{tenderStatus}
+			</if>
+		where id = #{id} ;
+	</update>
+
+    <!-- 逻辑删除 -->
+    <delete id="delete">
+        UPDATE  bidding_management_info SET
+		del_flag = 1
+		WHERE id = #{id}
+    </delete>
+
+</mapper>

+ 43 - 0
src/main/resources/mappings/modules/projectrecord/ProjectRecordsDao.xml

@@ -151,6 +151,49 @@
 		</choose>
 	</select>
 
+	<select id="findListByBiddingManagement" resultType="ProjectRecords" >
+		SELECT
+		<include refid="projectRecordsColumns"/>
+		,
+		wci.name AS "workContractInfo.name",
+		wct.id AS "workContractInfo.client.id",
+		wct.name AS "workContractInfo.client.name",
+		o.top_company AS "office.name"
+		FROM project_records a
+		<include refid="projectRecordsJoins"/>
+
+		<if test="leaderNameStr !=null and leaderNameStr !=''">
+			LEFT JOIN work_project_user w on a.id = w.project_id
+			LEFT JOIN sys_user su on w.user_id = su.id
+		</if>
+		left join project_assess_info pai on a.id =pai.project_id
+		LEFT JOIN work_project_user w1 on a.id = w1.project_id
+		LEFT JOIN work_contract_info wci on a.contract_id = wci.id
+		LEFT JOIN work_client_info wct on wci.client_id = wct.id
+		LEFT JOIN sys_office o ON o.id = a.office_id
+		<where>
+			<if test="projectStatus !=null">
+				AND pai.status = #{projectStatus}
+			</if>
+		</where>
+		GROUP BY a.id
+		<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="queryCountByBiddingManagement" resultType="int">
+		select count(distinct a.id)
+        from project_records a
+		left join project_assess_info pai on a.id =pai.project_id
+		where pai.status=#{projectStatus}
+	</select>
+
     <select id="queryCount" resultType="int" >
         SELECT count(DISTINCT a.id)
         FROM project_records a

+ 247 - 0
src/main/webapp/webpage/modules/biddingManagement/biddingManagementForm.jsp

@@ -0,0 +1,247 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>投标管理</title>
+	<meta name="decorator" content="default"/>
+    <style>
+        label.error{
+            left:0px;
+            top:40px;
+        }
+    </style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                var tenderStatus = $("#tenderStatus").val();
+                if("中标" == tenderStatus){
+                    var num = $("#file_attachment tr").length;
+                    if(num>0){
+                        $("#inputForm").submit();
+                        return true;
+                    }else{
+                        layer.alert('项目已中标,请上传中标通知书', {
+                            icon: 5,
+                            title: "上传中标通知书"
+                        });
+                    }
+                    return false;
+                }
+                $("#inputForm").submit();
+                return true;
+            }
+	
+		  return false;
+		}
+        $(document).ready(function() {
+            $(".td1").removeClass("hide");
+            $(".td2").addClass("hide");
+            $("input[name='ext']").on('ifChecked', function(event){
+                var radioVal = $(this).val();
+                if(radioVal == 0){
+                    $(".td1").removeClass("hide");
+                    $(".td2").addClass("hide");
+                }else{
+                    $(".td1").addClass("hide");
+                    $(".td2").removeClass("hide");
+                }
+            });
+            if("${workReimbursement.ext}" == "1"){
+                $("#ext1").iCheck('check')
+            }else{
+                $("#ext").iCheck('check')
+            }
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            laydate.render({
+                elem: '#tenderTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+            $("#attachment_btn").click(function () {
+                $("#attachment_file").click();
+            });
+        });
+
+        function insertTitle(tValue){
+            var list = "${workGoOut.workAttachments}";
+            var size = (list.split('url')).length-1;
+            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+            var attachmentId = "";
+            var attachmentFlag = "102";
+            console.log(file);
+            var timestamp=new Date().getTime();
+
+            var storeAs = "attachment-file/workIncomingMessage/"+timestamp+"/"+file['name'];
+            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+            var divId = "_attachment";
+            $("#addFile"+divId).show();
+            multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
+        }
+        function setPNumber(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoice/workInvoice/getPNumber',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#pNumber").val(d.pNumber);
+                    $("#cInfoName").val(d.cInfoName);
+                    $("#cName").val(d.cName);
+                }
+            })
+        }
+	</script>
+</head>
+<body>
+    <div class="single-form">
+        <div class="container">
+            <form:form id="inputForm" modelAttribute="biddingManagement" action="${ctx}/management/biddingManagement/save" method="post" class="form-horizontal">
+                <input type="hidden" id="projectId" name="projectId" value="">
+            <form:hidden path="id"/>
+                <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">
+                            <input type="radio" class="i-checks" name="ext" checked id="ext" value="0">
+                            <label for="ext">项目已评估</label>
+                            <input type="radio" class="i-checks" name="ext" id="ext1" value="1">
+                            <label for="ext1">项目未评估</label>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group layui-row">
+                    <div class="layui-item layui-col-sm6 td1">
+                        <label class="layui-form-label double-line"><span class="require-item">*</span>评估项目名称:</label>
+                        <div class="layui-input-block  with-icon">
+                            <input type="hidden" value="" id ="ids">
+                            <sys:gridselectcallprojectt url="${ctx}/management/biddingManagement/selectProject" id="project" name="project.id"  value="${biddingManagement.projectId}"  title="选择所属项目" labelName="biddingManagement.projectName"
+                                                        labelValue="${biddingManagement.projectName}" cssClass="form-control required layui-input" fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallprojectt>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6 td2">
+                        <label class="layui-form-label double-line"><span class="require-item">*</span>投标项目名称:</label>
+                        <div class="layui-input-block">
+                            <form:input path="projectName" htmlEscape="false" class="form-control layui-input required"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label double-line">投标记录编号:</label>
+                        <div class="layui-input-block">
+                            <div class="input-group">
+                                <form:input path="biddingId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                            </div>
+                        </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 class="laydate-icondate layui-input form-control layer-date laydate-icon required" id="tenderTime" name="tenderTime" value="<fmt:formatDate value="${biddingManagement.tenderTime}" pattern="yyyy-MM-dd"/>">
+                        </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">
+                            <select id="tenderStatus" name="tenderStatus" class="form-control simple-select required" lay-verify="">
+                                <option value="">--请选择投标状态--</option>
+                                <option value="未开标" <c:if test="${biddingManagement.tenderStatus eq '未开标' }">selected</c:if>>未开标</option>
+                                <option value="中标" <c:if test="${biddingManagement.tenderStatus eq '中标' }">selected</c:if>>中标</option>
+                                <option value="未中标" <c:if test="${biddingManagement.tenderStatus eq '未中标' }">selected</c:if>>未中标</option>
+                            </select>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm12 with-textarea">
+                        <label class="layui-form-label double-line">备    注:</label>
+                        <div class="layui-input-block">
+                            <form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="255" class="form-control"/>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group layui-row">
+                    <div class="form-group-label double-line"><h2>上传中标通知书</h2></div>
+                    <div class="layui-item nav-btns">
+                        <a id="attachment_btn" class="nav-btn nav-btn-add" title="上传中标通知书"><i class="fa fa-plus"></i>&nbsp;上传中标通知书</a>
+                    </div>
+                    <div id="addFile_attachment" style="display: none" class="upload-progress">
+                        <span id="fileName_attachment" ></span>
+                        <b><span id="baifenbi_attachment" ></span></b>
+                        <div class="progress">
+                            <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                            </div>
+                        </div>
+                    </div>
+                    <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                    <span id="attachment_title"></span>
+                    <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                        <table id="upTable" class="table table-bordered table-condensed details">
+                            <thead>
+                            <tr>
+                                    <%-- <th>序号</th>--%>
+                                <th>文件预览</th>
+                                <th>上传人</th>
+                                <th>上传时间</th>
+                                <th width="150px">操作</th>
+                            </tr>
+                            </thead>
+                            <tbody id="file_attachment">
+                            <c:forEach items="${biddingManagement.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                <tr>
+                                        <%-- <td>${status.index + 1}</td>--%>
+                                    <c:choose>
+                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                            <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                    <td>${workClientAttachment.createBy.name}</td>
+                                    <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                    <td class="op-td">
+                                        <div class="op-btn-box" >
+                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+
+                                            <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
+                                                <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                            </c:if>
+                                        </div>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+	        </form:form>
+        </div>
+    </div>
+</body>
+</html>

+ 276 - 0
src/main/webapp/webpage/modules/biddingManagement/biddingManagementList.jsp

@@ -0,0 +1,276 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>合同归档管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+        $(document).ready(function() {
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+            });
+
+
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+            });
+        });
+        function switchInput(obj){
+            $("#"+obj).show();
+            $("#"+obj).siblings().hide();
+        }
+        function openDialogre(title,url,width,height,target){
+
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: false, //开启最大化最小化按钮
+                skin: 'three-btns',
+                content: url ,
+                btn: ['送审','暂存','关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        top.layer.close(index);//关闭对话框。
+//                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                    return false;
+                },
+                btn3: function(index){
+                }
+            });
+        }
+        function openDialogreplay(title,url,width,height,target){
+
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: false, //开启最大化最小化按钮
+                skin: 'two-btns',
+                content: url ,
+                btn: ['送审','关闭'],
+                yes: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+
+                    if(iframeWin.contentWindow.doSubmit() ){
+                        top.layer.close(index);//关闭对话框。
+                        //setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+
+                },
+                cancel: function(index){
+                }
+            });
+        }
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="contentShadow layui-row" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="biddingManagement" action="${ctx}/management/biddingManagement/" 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}"/>
+
+					<div class="commonQuery lw8">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">投标项目名称:</label>
+							<div class="layui-input-block">
+								<input htmlEscape="false" id="projectName" name="projectName"  class="form-control layui-input" value="${projectName}"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">投标状态:</label>
+							<div class="layui-input-block">
+								<select name="tenderStatus" class="form-control simple-select" lay-verify="">
+									<option value="">--请选择投标状态--</option>
+									<option value="未开标" <c:if test="${tenderStatus eq '未开标' }">selected</c:if>>未开标</option>
+									<option value="中标" <c:if test="${tenderStatus eq '中标' }">selected</c:if>>中标</option>
+									<option value="未中标" <c:if test="${tenderStatus eq '未中标' }">selected</c:if>>未中标</option>
+								</select>
+								<%--<form:select path="status"  class="form-control simple-select">
+									<form:option value="" label="--请选择投标状态--"/>
+									<form:options items="${fns:getDictList('the_winning_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>--%>
+							</div>
+							<div style="clear:both;"></div>
+						</div>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
+								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+					<div id="moresees" class="lw8" style="clear:both;display:none;">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">创建时间:</label>
+							<div class="layui-input-block">
+								<input id="beginDate" 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="${beginDate}" pattern="yyyy-MM-dd"/>"/>
+								</input>
+								<span class="group-sep">-</span>
+								<input id="endDate" 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="${endDate}" pattern="yyyy-MM-dd"/>"/>
+								</input>
+							</div>
+						</div>
+
+					</div>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="contentShadow layui-form contentDetails">
+				<div class="nav-btns">
+
+					<shiro:hasPermission name="workcontractinfo:workContractInfo:add">
+						<table:addRow url="${ctx}/management/biddingManagement/form" title="新增投标信息"></table:addRow><!-- 增加按钮 -->
+					</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>
+				</div>
+				<table class="oa-table layui-table" id="contentTable"></table>
+
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+	<div id="changewidth"></div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+            ,elem: '#contentTable'
+            ,page: false
+            ,cols: [[
+                {field:'index',align:'center', title: '序号',width:40}
+                ,{field:'recordNum',align:'center',title: '投标项目名称',width:200,templet:function(d){
+                        return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/project/projectRecords/view?id=" + d.projectId +"','95%', '95%')\">" + d.projName + "</a>";
+                    }}
+                ,{field:'biddingId',align:'center', title: '投标记录编号',width:200,templet:function(d){
+                        return "<a class=\"attention-info\" title=\"" + d.biddingId + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看投标管理信息', '${ctx}/management/biddingManagement/view?id=" + d.id +"','95%', '95%')\">" + d.biddingId + "</a>";
+                    }}
+                ,{field:'tenderStatus', align:'center',title: '投标状态', width:180,templet:function(d){
+                        return "<span title=\"" + d.tenderStatus + "\">" + d.tenderStatus + "</span>";
+                    }}
+                ,{field:'tenderTime',align:'center', title: '投标时间',  width:185}
+                ,{field:'createDate',align:'center', title: '创建日期'}
+                ,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="";
+                        xml +="<a href=\"javascript:void(0)\" onclick=\"openDialog('修改投标信息', '${ctx}/management/biddingManagement/form?id=" + d.id + "','95%', '95%','','确定,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改</a>";
+                        xml+="<a href=\"${ctx}/management/biddingManagement/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该投标信息吗?', this.href)\" class=\"op-btn op-btn-delete\"><i class=\"fa fa-trash\"></i> 删除</a>";
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="biddingManagement" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${biddingManagement.id}"
+                    ,"projName":"${biddingManagement.projectName}"
+                    ,"biddingId":"${biddingManagement.biddingId}"
+                    ,"tenderStatus":"${biddingManagement.tenderStatus}"
+                    ,"tenderTime":"<fmt:formatDate value="${biddingManagement.tenderTime}" pattern="yyyy-MM-dd"/>"
+                    ,"createDate":"<fmt:formatDate value="${biddingManagement.createDate}" pattern="yyyy-MM-dd"/>"
+                    ,"projectId":"${biddingManagement.projectId}"
+                }
+                </c:forEach>
+                </c:if>
+            ]
+        });
+
+    })
+
+    resizeListTable();
+</script>
+<script>
+    resizeListWindow1();
+    $(window).resize(function(){
+        resizeListWindow1();
+    });
+</script>
+</body>
+</html>

+ 203 - 0
src/main/webapp/webpage/modules/biddingManagement/biddingManagementView.jsp

@@ -0,0 +1,203 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>投标管理</title>
+	<meta name="decorator" content="default"/>
+    <style>
+        label.error{
+            left:0px;
+            top:40px;
+        }
+    </style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }
+	
+		  return false;
+		}
+        $(document).ready(function() {
+            $(".td1").removeClass("hide");
+            $(".td2").addClass("hide");
+            $("input[name='ext']").on('ifChecked', function(event){
+                var radioVal = $(this).val();
+                if(radioVal == 0){
+                    $(".td1").removeClass("hide");
+                    $(".td2").addClass("hide");
+                }else{
+                    $(".td1").addClass("hide");
+                    $(".td2").removeClass("hide");
+                }
+            });
+            if("${workReimbursement.ext}" == "1"){
+                $("#ext1").iCheck('check')
+            }else{
+                $("#ext").iCheck('check')
+            }
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            /*laydate.render({
+                elem: '#tenderTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });*/
+            $("#attachment_btn").click(function () {
+                $("#attachment_file").click();
+            });
+        });
+
+        function insertTitle(tValue){
+            var list = "${workGoOut.workAttachments}";
+            var size = (list.split('url')).length-1;
+            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+            var attachmentId = "";
+            var attachmentFlag = "102";
+            console.log(file);
+            var timestamp=new Date().getTime();
+
+            var storeAs = "attachment-file/workIncomingMessage/"+timestamp+"/"+file['name'];
+            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+            var divId = "_attachment";
+            $("#addFile"+divId).show();
+            multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
+        }
+        function setPNumber(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoice/workInvoice/getPNumber',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#pNumber").val(d.pNumber);
+                    $("#cInfoName").val(d.cInfoName);
+                    $("#cName").val(d.cName);
+                }
+            })
+        }
+	</script>
+</head>
+<body>
+    <div class="single-form">
+        <div class="container">
+            <form:form id="inputForm" modelAttribute="biddingManagement" action="${ctx}/management/biddingManagement/save" method="post" class="form-horizontal">
+                <input type="hidden" id="projectId" name="projectId" value="">
+            <form:hidden path="id"/>
+                <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">评估类型:</label>
+                        <div class="layui-input-block">
+                            <input readonly="true" htmlEscape="false" class="form-control layui-input"
+                                   value="<c:choose><c:when test="${biddingManagement.ext == 0}">项目已评估</c:when><c:otherwise>项目未评估</c:otherwise></c:choose>"/>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group layui-row">
+                    <div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label double-line">投标项目名称:</label>
+                        <div class="layui-input-block">
+                            <form:input path="projectName" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label double-line">投标记录编号:</label>
+                        <div class="layui-input-block">
+                            <form:input path="biddingId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label double-line">投标时间:</label>
+                        <div class="layui-input-block">
+                            <input readonly="true" class="laydate-icondate layui-input form-control layer-date laydate-icon required" id="tenderTime" name="tenderTime" value="<fmt:formatDate value="${biddingManagement.tenderTime}" pattern="yyyy-MM-dd"/>">
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label double-line">投标项目名称:</label>
+                        <div class="layui-input-block">
+                            <form:input path="tenderStatus" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm12 with-textarea">
+                        <label class="layui-form-label double-line">备    注:</label>
+                        <div class="layui-input-block">
+                            <form:textarea path="remarks" readonly="true" htmlEscape="false" rows="3" maxlength="255" class="form-control"/>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group layui-row">
+                    <div id="addFile_attachment" style="display: none" class="upload-progress">
+                        <span id="fileName_attachment" ></span>
+                        <b><span id="baifenbi_attachment" ></span></b>
+                        <div class="progress">
+                            <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                            </div>
+                        </div>
+                    </div>
+                    <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                    <span id="attachment_title"></span>
+                    <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                        <table id="upTable" class="table table-bordered table-condensed details">
+                            <thead>
+                            <tr>
+                                    <%-- <th>序号</th>--%>
+                                <th>文件预览</th>
+                                <th>上传人</th>
+                                <th>上传时间</th>
+                            </tr>
+                            </thead>
+                            <tbody id="file_attachment">
+                            <c:forEach items="${biddingManagement.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                <tr>
+                                        <%-- <td>${status.index + 1}</td>--%>
+                                    <c:choose>
+                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                            <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                    <td>${workClientAttachment.createBy.name}</td>
+                                    <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+
+                                </tr>
+                            </c:forEach>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+	        </form:form>
+        </div>
+    </div>
+</body>
+</html>