| | |
| | | public static final String LX_PROJECT_TASK_ALLOCATION_SUB = "product_project_task_allocation_sub"; //任务分配表 |
| | | public static final String LX_PROJECT_TASK_PROGRESS = "product_project_task_progress"; //任务进度表 |
| | | public static final String PRODUCT_PROJECT_SCHEDULE = "product_project_schedule";//任务进度 |
| | | public static final String PRODUCT_PROJECT_BUSINESS_TRANSLATE = "product_project_business_translate";//任务进度 |
| | | |
| | | public static final String PRODUCT_PROJECT_BUSINESS = "product_project_business";//项目表 |
| | | public static final String PRODUCT_PROJECT_BUSINESS_PLAN = "product_project_business_plan";//项目计划表 |
| | |
| | | public static final String CPAGE = "cpage"; // 页数 |
| | | public static final String PAGESIZE = "pagesize"; // 每页条数 |
| | | public static final String PROJECT_UUID = "project_uuid"; |
| | | public static final String PROJECT_TYPE = "project_type"; |
| | | |
| | | |
| | | } |
| | |
| | | PROJECT_SCHEDULE_OPERATE_FAIL("项目进度信息操作失败:", ModuleEnum.CONTRACT.getValue() +"046"), |
| | | PROJECT_SCHEDULE_SAVE_FAIL("项目进度保存失败", ModuleEnum.CONTRACT.getValue() +"047"), |
| | | PROJECT_COMMOSSION_OPERATE_FAIL("项目提成操作失败:", ModuleEnum.CONTRACT.getValue() +"048"), |
| | | SYSTEM_FIND_CONTRACT_PROJECT_TRANSLATE_FAIL("获取项目进度模版详情失败", ModuleEnum.CONTRACT.getValue() + "049"), |
| | | SYSTEM_FIND_CONTRACT_PROJECT_TYPE_FAIL("项目类型错误", ModuleEnum.CONTRACT.getValue() + "050"), |
| | | |
| | | ; |
| | | |
| | |
| | | return error(SystemCode.SYSTEM_SAVE_PROJECT_FAIL.getValue(), SystemCode.SYSTEM_SAVE_PROJECT_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 项目进度模版详情 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value="/translate-find/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String translateFind(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = null; |
| | | Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); |
| | | if (bean != null) { |
| | | RequestParameterEntity reqp = (RequestParameterEntity) bean; |
| | | fse = reqp.getFormData(); |
| | | } |
| | | // 判断参数是否为空 |
| | | if (bean == null || fse == null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), |
| | | SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | } |
| | | // 判断项目类型是否为空 |
| | | if (com.alibaba.druid.util.StringUtils.isEmpty(fse.getString(CmnConst.PROJECT_TYPE))) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FIND_CONTRACT_PROJECT_TYPE_FAIL.getValue(), |
| | | SystemCode.SYSTEM_FIND_CONTRACT_PROJECT_TYPE_FAIL.getText()); |
| | | return this.error(SystemCode.SYSTEM_FIND_CONTRACT_PROJECT_TYPE_FAIL.getValue(), SystemCode.SYSTEM_FIND_CONTRACT_PROJECT_TYPE_FAIL.getText()); |
| | | } |
| | | |
| | | return ResultInfo.success(projectBusinessService.findTranslate(fse)); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(SystemCode.SYSTEM_FIND_CONTRACT_PROJECT_TRANSLATE_FAIL.getValue(), SystemCode.SYSTEM_FIND_CONTRACT_PROJECT_TRANSLATE_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 项目立项保存 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value="/translate-save/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String translateSave(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_PROJECT_BUSINESS_TRANSLATE); |
| | | IProjectBusinessService service = (IProjectBusinessService) getProxyInstance(projectBusinessService); |
| | | |
| | | boolean succ = service.saveTranslate(fse); |
| | | if (succ) { |
| | | return OK(); |
| | | } |
| | | return error(SystemCode.SYSTEM_SAVE_PROJECT_FAIL.getValue(), SystemCode.SYSTEM_SAVE_PROJECT_FAIL.getText()); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(SystemCode.SYSTEM_SAVE_PROJECT_FAIL.getValue(), SystemCode.SYSTEM_SAVE_PROJECT_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.product.core.transfer.Transactional; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.util.BaseUtil; |
| | | import org.apache.bcel.generic.IF_ACMPEQ; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | StringBuilder filter=new StringBuilder(128); |
| | | filter.append(" uuid='"+cfs.getValues().get("project_uuid")+"'"); |
| | | DataTableEntity product_project_business = baseDao.listTable("product_project_business",filter.toString(),new Object[]{}); |
| | | String guarantee_period = product_project_business.getData().get(0).getValues().get("guarantee_period").toString(); |
| | | // String guarantee_period = product_project_business.getData().get(0).getValues().get("guarantee_period").toString(); |
| | | String guarantee_period = product_project_business.getString(0, "guarantee_period"); |
| | | StringBuilder dictFilter=new StringBuilder(128); |
| | | dictFilter.append("dict_name='项目管理项目类型' and dict_value="+product_project_business.getData().get(0).getValues().get("project_type").toString()); |
| | | DataTableEntity product_sys_dict = baseDao.listTable("product_sys_dict", dictFilter.toString(), new Object[]{}); |
| | |
| | | } |
| | | //结束日期: 如果是开发项目、实施项目,验收日期+合同有效期,维护合同则是签定日期+合同有效期 |
| | | if(dict_label.equals("开发项目") || dict_label.equals("实施项目")){ |
| | | String carefully_check = product_project_business.getData().get(0).getValues().get("carefully_check").toString(); |
| | | String[] dateTime = carefully_check.split(" "); |
| | | String time=dateTime[0]; |
| | | String date = getDate(time,guarantee_period); |
| | | cfs.setValue("end_time",date); |
| | | // String carefully_check = product_project_business.getData().get(0).getValues().get("carefully_check").toString(); |
| | | String carefully_check = product_project_business.getString(0, "carefully_check"); |
| | | if (!StringUtils.isEmpty(carefully_check)){ |
| | | String[] dateTime = carefully_check.split(" "); |
| | | String time=dateTime[0]; |
| | | String date = getDate(time,guarantee_period); |
| | | cfs.setValue("end_time",date); |
| | | } |
| | | } |
| | | return cfs; |
| | | } |
| | |
| | | rejson.put(CmnConst.PRODUCT_PROJECT_MANAGER_DATA_LIST,BaseUtil.dataTableEntityToJson(dataList)); |
| | | return rejson; |
| | | } |
| | | @Override |
| | | public JSONObject findTranslate(FieldSetEntity fse) { |
| | | FieldSetEntity fsData = baseDao.getFieldSetBySQL("SELECT project_type,date FROM product_project_business_translate where project_type=?", new String[]{fse.getString("project_type")}, false); |
| | | JSONObject rejson=BaseUtil.fieldSetEntityToJson(fsData); |
| | | DataTableEntity projectType = baseDao.listTable(CmnConst.PRODUCT_PROJECT_BUSINESS_TRANSLATE, "project_type=? ORDER BY project_task", new String[]{fse.getString("project_type")}); |
| | | JSONObject json = new JSONObject(); |
| | | for (int i = 0; i < projectType.getRows(); i++) { |
| | | FieldSetEntity fs = projectType.getFieldSetEntity(i); |
| | | if (json.getJSONArray(fs.getString("project_task"))==null){ |
| | | JSONArray objects = new JSONArray(); |
| | | objects.add(BaseUtil.fieldSetEntityToJson(fs)); |
| | | json.put(fs.getString("project_task"),objects); |
| | | |
| | | |
| | | }else { |
| | | JSONArray projectTask = json.getJSONArray(fs.getString("project_task")); |
| | | projectTask.add(BaseUtil.fieldSetEntityToJson(fs)); |
| | | } |
| | | } |
| | | rejson.put(CmnConst.PRODUCT_PROJECT_BUSINESS_TRANSLATE,json); |
| | | |
| | | |
| | | return rejson; |
| | | } |
| | | @Transactional |
| | | @Override |
| | | public boolean saveTranslate(FieldSetEntity fs) { |
| | | DataTableEntity dt = fs.getSubDataTable(CmnConst.PRODUCT_PROJECT_BUSINESS_TRANSLATE); |
| | | boolean a=true; |
| | | for (int i = 0; i < dt.getRows(); i++) { |
| | | FieldSetEntity fse = dt.getFieldSetEntity(i); |
| | | fse.setValue("project_type",fs.getString("project_type")); |
| | | fse.setValue("date",fs.getString("date")); |
| | | BaseUtil.createCreatorAndCreationTime(fse); |
| | | if (fse.getUUID()==null){ |
| | | String uuid= baseDao.add(fse); |
| | | if (uuid==null) a= false; |
| | | }else if (fse.getString("~type~")!=null&&fse.getString("~type~").equals("del")){ |
| | | boolean delete = baseDao.delete(CmnConst.PRODUCT_PROJECT_BUSINESS_TRANSLATE, "uuid=?", new String[]{fse.getUUID()}); |
| | | if (!delete) a= false; |
| | | }else { |
| | | boolean update = baseDao.update(fse); |
| | | if (!update) a= false; |
| | | } |
| | | } |
| | | return a; |
| | | } |
| | | @Transactional |
| | | @Override |
| | | public boolean saveProject(FieldSetEntity fse) { |
| | |
| | | package com.product.contract.service.ide; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.product.core.entity.DataTableEntity; |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.transfer.Transactional; |
| | | |
| | | public interface IProjectBusinessService { |
| | | |
| | | JSONObject findProject(FieldSetEntity fse); |
| | | |
| | | JSONObject findTranslate(FieldSetEntity fse); |
| | | |
| | | @Transactional |
| | | boolean saveTranslate(FieldSetEntity fs); |
| | | |
| | | boolean saveProject(FieldSetEntity fse); |
| | | } |