diff --git a/src/com/base/system_templates.xlsx b/src/com/base/system_templates.xlsx index f92be336..4a76dafb 100644 Binary files a/src/com/base/system_templates.xlsx and b/src/com/base/system_templates.xlsx differ diff --git a/src/com/dao/mapper/data-details-mapper.xml b/src/com/dao/mapper/data-details-mapper.xml index 32c4695b..41ccf614 100644 --- a/src/com/dao/mapper/data-details-mapper.xml +++ b/src/com/dao/mapper/data-details-mapper.xml @@ -282,5 +282,33 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" AND remove ='0' + + + UPDATE + data_info + + + + data_path= #{dataPath}, + + + extract_status= #{extractStatus}, + + + checkout_pay_last= #{payResultLast}, + + + checkout_indicate_last= #{execResultLast}, + + + checkout_flag= #{checkoutFlag}, + + + + + id = #{id} + AND remove ='0' + + \ No newline at end of file diff --git a/src/com/dao/mapper/standard_data_details-mapper.xml b/src/com/dao/mapper/standard_data_details-mapper.xml index f41ef6f4..839a46c1 100644 --- a/src/com/dao/mapper/standard_data_details-mapper.xml +++ b/src/com/dao/mapper/standard_data_details-mapper.xml @@ -18,8 +18,11 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" jdbcType="VARCHAR" /> - + + + + + @@ -67,8 +84,8 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" AND standard_data_details.district_name=#{districtName} - - AND standard_data_details.data_version=#{dataVersion} + + AND standard_data_details.sys_version=#{sysVersion} AND standard_data_details.system_name=#{systemName} @@ -82,12 +99,22 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" - id,area_code,city_name,district_name,system_name,sys_code,area_level,data_version,begin_in_use,function_details, + id,area_code,city_name,district_name,system_name,sys_code,area_level,sys_version,begin_in_use,function_details, department_manager,manager_contacts,sys_developer_full_name,data_base_type,data_base_version, is_budget_exec,is_budget_quota,is_collection,is_department_budget,total_budget_account, final_account_manage,report_form_manage,non_tax_revenue_manage,wage_system, analysis_of_financial_economic_prosperity,government_debt + + + + d.id dataId,a.area_code areaCode,a.city_name cityName,a.district_name districtName,a.system_name sysName,a.sys_code sysCode,a.area_level areaLevel,a.sys_version sysVersion,a.begin_in_use beginUseTime,a.function_details functionDetails, + a.department_manager departmentManager,a.manager_contacts managerContacts,a.sys_developer_full_name developerFullName,a.data_base_type dataBaseType,a.data_base_version dataBaseVersion, + a.is_budget_exec budgetExecManage,a.is_budget_quota budgetQuotaManage,a.is_collection collection,a.is_department_budget departmentBudgetManage,a.total_budget_account totalBudgetAccount, + a.final_account_manage finalAccountManage,a.report_form_manage reportFormManage,a.non_tax_revenue_manage nonTaxManage,a.wage_system wageSystem, + a.analysis_of_financial_economic_prosperity analysisOfFinancialEconomicProsperity,a.government_debt governmentDebtManage,d.data_version dataVersion,d.collection_time collectingTime,l.is_update collUpdate, + d.checkout_indicate execResult,d.checkout_pay payResult,d.checkout_flag checkoutFlag,d.checkout_indicate_last execResultLast,d.checkout_pay_last payResultLast + + + SELECT CONCAT(area_code,',',system_name) @@ -267,5 +314,24 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" + + + \ No newline at end of file diff --git a/src/com/platform/controller/CheckoutController.java b/src/com/platform/controller/CheckoutController.java new file mode 100644 index 00000000..0f4b9749 --- /dev/null +++ b/src/com/platform/controller/CheckoutController.java @@ -0,0 +1,133 @@ +package com.platform.controller; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.base.BaseController; +import com.platform.entities.CheckoutEntity; +import com.platform.entities.PreDataInfo; +import com.platform.service.ICheckoutService; +import com.platform.utils.Configs; + +/** 信息系统--校验 + * @author chen + * + */ +@Controller +@RequestMapping("/checkout") +public class CheckoutController extends BaseController { + @SuppressWarnings("static-access") + public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(CheckoutController.class); + + @Resource(name = "checkoutService") + private ICheckoutService checkoutService; + + /** + * 查看所有系统的 标准表情况 + * @return + * @throws Exception + */ + @ResponseBody + @RequestMapping("/findAll") + public ModelMap findAll() throws Exception { + log.info("---------/findAll--- "); + ModelMap modelMap = new ModelMap(); + List result = checkoutService.findAll(); + modelMap.addAttribute("data", result); + modelMap.addAttribute("length", result.size()); + return modelMap; + } + + /** + * 查看所有系统的 标准表情况 + * @return + * @throws Exception + */ + @ResponseBody + @RequestMapping("/findByCity") + public ModelMap findByCity(@RequestBody String cityName, HttpServletRequest req, HttpServletResponse res) throws Exception { + log.info("---------/findByCity--- "+cityName); + ModelMap modelMap = new ModelMap(); + List result = checkoutService.findByCity(cityName); + modelMap.addAttribute("data", result); + modelMap.addAttribute("length", result.size()); + return modelMap; + } + + /** + * 校验勾选的数据 + * @return + * @throws Exception + */ + @ResponseBody + @RequestMapping("/checkList") + public ModelMap checkList(@RequestBody List form, HttpServletRequest req, HttpServletResponse res) throws Exception { + ModelMap modelMap = new ModelMap(); + if (null != form) { + log.info("---------/checkList--- "+ form.size()); + List result = checkoutService.checkAll(form); + List data = new ArrayList(); + modelMap.addAttribute("data", result); + modelMap.addAttribute("length", result.size()); + } + else { + log.info("---------/checkList--- "+ form); + } + return modelMap; + } + + /** + * 查看单条数据的修改详情 + * @return + * @throws Exception + */ + @ResponseBody + @RequestMapping("/findDetails") + public ModelMap findDetails(@RequestBody CheckoutEntity form, HttpServletRequest req, HttpServletResponse res) throws Exception { + ModelMap modelMap = new ModelMap(); + if (null != form) { + log.info("---------/findDetails--- "+ form); + + Map result = checkoutService.findDetail(form); + modelMap.addAllAttributes(result); + } + else { + log.info("---------/findDetails--- "+ form); + } + return modelMap; + } + + /** + * 查看单条数据的修改详情 + * @return + * @throws Exception + */ + @ResponseBody + @RequestMapping("/update") + public void update(@RequestBody PreDataInfo form, HttpServletRequest req, HttpServletResponse res) throws Exception { + if (null != form) { + log.info("---------/update--- "+ form); + int result = checkoutService.updateStandardInfo(form); + if (result == 0) { + res.setStatus(500); + } + } + else { + log.info("---------/update--- "+ form); + res.setStatus(500); + } + } +} diff --git a/src/com/platform/controller/DataModelController.java b/src/com/platform/controller/DataModelController.java index 4bae752d..d88dcf7a 100644 --- a/src/com/platform/controller/DataModelController.java +++ b/src/com/platform/controller/DataModelController.java @@ -50,6 +50,10 @@ import com.platform.utils.Configs; import com.platform.utils.Constant; import com.platform.utils.UtilsHelper; +/** 数据管理 + * @author chen + * + */ @Controller public class DataModelController extends BaseController { diff --git a/src/com/platform/controller/ExcelController.java b/src/com/platform/controller/ExcelController.java index effb9e59..e4e3ed56 100644 --- a/src/com/platform/controller/ExcelController.java +++ b/src/com/platform/controller/ExcelController.java @@ -53,6 +53,10 @@ import com.platform.utils.HttpUtils; import com.platform.utils.ThreadRemoveFile; import com.platform.utils.UtilsHelper; +/** 信息系统--excel操作 + * @author chen + * + */ @Controller @RequestMapping("/fileOperation") public class ExcelController extends BaseController{ diff --git a/src/com/platform/controller/FilePackageController.java b/src/com/platform/controller/FilePackageController.java index 2961ae71..ea7cbb2c 100644 --- a/src/com/platform/controller/FilePackageController.java +++ b/src/com/platform/controller/FilePackageController.java @@ -76,7 +76,7 @@ public class FilePackageController extends BaseController { public ModelMap findAll() throws Exception { log.info("---------/findAll--- "); ModelMap modelMap = new ModelMap(); - List result = scriptMakeService.FindAllFiles(); + List result = scriptMakeService.findAllFiles(); modelMap.addAttribute("data", result); modelMap.addAttribute("length", result.size()); return modelMap; @@ -124,7 +124,7 @@ public class FilePackageController extends BaseController { ModelMap modelMap = new ModelMap(); Map result = scriptMakeService.handleSqlFile(type, opt, form.getContent(), form.getItem()); modelMap.addAllAttributes(result); - List results = scriptMakeService.FindAllFiles(); + List results = scriptMakeService.findAllFiles(); modelMap.addAttribute("data", results); modelMap.addAttribute("length", results.size()); return modelMap; diff --git a/src/com/platform/dao/DataInfoDao.java b/src/com/platform/dao/DataInfoDao.java index feef60a0..edab2e73 100644 --- a/src/com/platform/dao/DataInfoDao.java +++ b/src/com/platform/dao/DataInfoDao.java @@ -28,6 +28,8 @@ public interface DataInfoDao { int save(DataInfoEntity data) throws Exception; + int update(DataInfoEntity data) throws Exception; + int updateExtract(DataInfoEntity data) throws Exception; } diff --git a/src/com/platform/dao/PreDataInfoDao.java b/src/com/platform/dao/PreDataInfoDao.java index 03f7289f..89cff3e7 100644 --- a/src/com/platform/dao/PreDataInfoDao.java +++ b/src/com/platform/dao/PreDataInfoDao.java @@ -6,6 +6,7 @@ import java.util.Map; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import com.platform.entities.CheckoutEntity; import com.platform.entities.DataInfoEntity; import com.platform.entities.DataInfoEntityMoveTmp; import com.platform.entities.PagerOptions; @@ -26,10 +27,18 @@ public interface PreDataInfoDao { List findAllCollect()throws Exception; + List findByCity(PreDataInfo pre)throws Exception; + void insertBatch(List list) throws Exception; int update(PreDataInfo data) throws Exception; + int updateCollection(PreDataInfo data) throws Exception; + + PreDataInfo findStandardByCode(PreDataInfo data) throws Exception; + + PreDataInfo findLastByCode(PreDataInfo data) throws Exception; + /** 查找 存在的 系统(根据 地区编码 和 系统编码) * @param list * @return diff --git a/src/com/platform/entities/CheckoutEntity.java b/src/com/platform/entities/CheckoutEntity.java index c9316fba..9ef4988b 100644 --- a/src/com/platform/entities/CheckoutEntity.java +++ b/src/com/platform/entities/CheckoutEntity.java @@ -1,6 +1,11 @@ package com.platform.entities; -public class CheckoutEntity extends PreDataInfo { +public class CheckoutEntity extends PreDataInfo implements Comparable { + + /** + * dataInfo 的id + */ + private int dataId; /** 验证结果 */ private String checkResult; @@ -10,6 +15,34 @@ public class CheckoutEntity extends PreDataInfo { /** 执行信息表 */ private String execResult; + + /** 支付信息表校验--汇总 */ + private String payResultLast; + + /** 执行信息表校验--汇总 */ + private String execResultLast; + + /** 是否进行了校验 */ + private String checkoutFlag; + + /** + * 描述更新-? + */ + private String mark; + + /** + * @return the dataId + */ + public int getDataId() { + return dataId; + } + + /** + * @param dataId the dataId to set + */ + public void setDataId(int dataId) { + this.dataId = dataId; + } /** * @return the checkResult @@ -52,5 +85,70 @@ public class CheckoutEntity extends PreDataInfo { public void setExecResult(String execResult) { this.execResult = execResult; } + + /** + * @return the payResultLast + */ + public String getPayResultLast() { + return payResultLast; + } + + /** + * @param payResultLast the payResultLast to set + */ + public void setPayResultLast(String payResultLast) { + this.payResultLast = payResultLast; + } + + /** + * @return the execResultLast + */ + public String getExecResultLast() { + return execResultLast; + } + + /** + * @param execResultLast the execResultLast to set + */ + public void setExecResultLast(String execResultLast) { + this.execResultLast = execResultLast; + } + + /** + * @return the checkoutFlag + */ + public String getCheckoutFlag() { + return checkoutFlag; + } + + /** + * @param checkoutFlag the checkoutFlag to set + */ + public void setCheckoutFlag(String checkoutFlag) { + this.checkoutFlag = checkoutFlag; + } + + /** + * @return the mark + */ + public String getMark() { + return mark; + } + + /** + * @param mark the mark to set + */ + public void setMark(String mark) { + this.mark = mark; + } + + /** 按checkResult的状态排序 */ + @Override + public int compareTo(CheckoutEntity arg0) { + if ("是".equals(arg0.getCheckResult())) { + return -1; + } + return 1; + } } diff --git a/src/com/platform/entities/DataInfoEntity.java b/src/com/platform/entities/DataInfoEntity.java index e45ce1d8..924c5cfb 100644 --- a/src/com/platform/entities/DataInfoEntity.java +++ b/src/com/platform/entities/DataInfoEntity.java @@ -39,12 +39,21 @@ public class DataInfoEntity { private String mark; - /** 支付信息表 */ + /** 支付信息表校验--采集 */ private String payResult; - /** 执行信息表 */ + /** 执行信息表校验--采集 */ private String execResult; + /** 支付信息表校验--汇总 */ + private String payResultLast; + + /** 执行信息表校验--汇总 */ + private String execResultLast; + + /** 是否进行了校验 */ + private String checkoutFlag; + public DataInfoEntity() { } @@ -317,6 +326,48 @@ public class DataInfoEntity { this.execResult = execResult; } + /** + * @return the payResultLast + */ + public String getPayResultLast() { + return payResultLast; + } + + /** + * @param payResultLast the payResultLast to set + */ + public void setPayResultLast(String payResultLast) { + this.payResultLast = payResultLast; + } + + /** + * @return the execResultLast + */ + public String getExecResultLast() { + return execResultLast; + } + + /** + * @param execResultLast the execResultLast to set + */ + public void setExecResultLast(String execResultLast) { + this.execResultLast = execResultLast; + } + + /** + * @return the checkoutFlag + */ + public String getCheckoutFlag() { + return checkoutFlag; + } + + /** + * @param checkoutFlag the checkoutFlag to set + */ + public void setCheckoutFlag(String checkoutFlag) { + this.checkoutFlag = checkoutFlag; + } + @Override public String toString() { return "id=" + this.id + " ,regionalismCode=" + this.regionalismCode diff --git a/src/com/platform/entities/DefaultDataDescription.java b/src/com/platform/entities/DefaultDataDescription.java index 86cde956..96915464 100644 --- a/src/com/platform/entities/DefaultDataDescription.java +++ b/src/com/platform/entities/DefaultDataDescription.java @@ -445,7 +445,7 @@ public class DefaultDataDescription { using_time = pre.getBeginUseTime(); - sys_version = pre.getDataVersion(); + sys_version = pre.getSysVersion(); sys_description = pre.getFunctionDetails(); diff --git a/src/com/platform/entities/PreDataInfo.java b/src/com/platform/entities/PreDataInfo.java index f36b7b67..2f2d3f4e 100644 --- a/src/com/platform/entities/PreDataInfo.java +++ b/src/com/platform/entities/PreDataInfo.java @@ -11,7 +11,7 @@ public class PreDataInfo { private String updateTime; - /** 是否更新 */ + /** excel 是否更新 */ private String isupdate = "-"; /** 是否采集 */ @@ -33,7 +33,7 @@ public class PreDataInfo { private String sysName; /** 系统版本信息 */ - private String dataVersion; + private String sysVersion; /** 投入使用时间 */ private String beginUseTime; @@ -109,6 +109,15 @@ public class PreDataInfo { /** 脚本文件名称列表 */ private List sqlList; + + /** 数据版本 */ + private int dataVersion; + + /** 采集时间 */ + private String collectingTime; + + /** collection_data_description 是否有更新 */ + private String collUpdate; /** * @return the id @@ -251,15 +260,15 @@ public class PreDataInfo { /** * @return the dataVersion */ - public String getDataVersion() { - return dataVersion; + public String getSysVersion() { + return sysVersion; } /** * @param dataVersion the dataVersion to set */ - public void setDataVersion(String dataVersion) { - this.dataVersion = dataVersion; + public void setSysVersion(String sysVersion) { + this.sysVersion = sysVersion; } /** @@ -611,17 +620,63 @@ public class PreDataInfo { } } + /** + * @return the dataVersion + */ + public int getDataVersion() { + return dataVersion; + } + + /** + * @param dataVersion the dataVersion to set + */ + public void setDataVersion(int dataVersion) { + this.dataVersion = dataVersion; + } + + /** + * @return the collectingTime + */ + public String getCollectingTime() { + return collectingTime; + } + + /** + * @param collectingTime the collectingTime to set + */ + public void setCollectingTime(String collectingTime) { + this.collectingTime = collectingTime; + } + + /** + * @return the isUpdate + */ + public String getCollUpdate() { + return collUpdate; + } + + /** + * @param isUpdate the isUpdate to set + */ + public void setCollUpdate(String collUpdate) { + this.collUpdate = collUpdate; + } + /** * @return the workRange */ public List getWorkRange() { return workRange; } + + public void setWorkRange(List workRange) { + this.workRange = workRange; + } /** * @param workRange the workRange to set */ - public void setWorkRange(List workRange) { + public void reSetWorkRange(List workRange) { this.workRange = workRange; if (null == this.workRange) { this.workRange = new ArrayList(); @@ -657,4 +712,52 @@ public class PreDataInfo { this.workRange.add("政府性债务管理"); } } + + public void setProper() { + departmentBudgetManage = "否"; + budgetQuotaManage = "否"; + budgetExecManage = "否"; + + totalBudgetAccount = "否"; + finalAccountManage = "否"; + reportFormManage = "否"; + + nonTaxManage = "否"; + wageSystem = "否"; + analysisOfFinancialEconomicProsperity = "否"; + governmentDebtManage = "否"; + if (null == this.workRange) { + return; + } + if (workRange.contains("部门预算管理")) { + departmentBudgetManage = "是"; + } + if (workRange.contains("预算指标管理")) { + budgetQuotaManage = "是"; + } + if (workRange.contains("预算执行管理")) { + budgetExecManage = "是"; + } + if (workRange.contains("总预算会计")) { + totalBudgetAccount = "是"; + } + if (workRange.contains("决算管理")) { + finalAccountManage = "是"; + } + if (workRange.contains("报表管理")) { + reportFormManage = "是"; + } + if (workRange.contains("非税收入管理")) { + nonTaxManage = "是"; + } + if (workRange.contains("工资统发系统")) { + wageSystem = "是"; + } + if (workRange.contains("财政经济景气预测与分析")) { + analysisOfFinancialEconomicProsperity = "是"; + } + if (workRange.contains("政府性债务管理")) { + governmentDebtManage = "是"; + } + } } diff --git a/src/com/platform/service/CheckoutService.java b/src/com/platform/service/CheckoutService.java deleted file mode 100644 index 9bc1fdc7..00000000 --- a/src/com/platform/service/CheckoutService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.platform.service; - -import java.util.List; - -import com.platform.entities.PreDataInfo; - -public interface CheckoutService { - - public List findAll() throws Exception; - - public void checkAll() throws Exception; - -} diff --git a/src/com/platform/service/ICheckoutService.java b/src/com/platform/service/ICheckoutService.java new file mode 100644 index 00000000..800c12b9 --- /dev/null +++ b/src/com/platform/service/ICheckoutService.java @@ -0,0 +1,20 @@ +package com.platform.service; + +import java.util.List; +import java.util.Map; + +import com.platform.entities.CheckoutEntity; +import com.platform.entities.PreDataInfo; + +public interface ICheckoutService { + + public List findAll() throws Exception; + + public List checkAll(List list) throws Exception; + + public int updateStandardInfo(PreDataInfo ck) throws Exception; + + public Map findDetail(CheckoutEntity ck) throws Exception; + + public List findByCity(String city) throws Exception; +} diff --git a/src/com/platform/service/IScriptMakeService.java b/src/com/platform/service/IScriptMakeService.java index 8f424982..5e7fc8cf 100644 --- a/src/com/platform/service/IScriptMakeService.java +++ b/src/com/platform/service/IScriptMakeService.java @@ -13,7 +13,7 @@ public interface IScriptMakeService { public int moveFiles(List file) throws Exception; - public List FindAllFiles() throws Exception; + public List findAllFiles() throws Exception; public Map readSql(String name, SqlFileInfoEntity form); diff --git a/src/com/platform/service/impl/CheckoutServiceImpl.java b/src/com/platform/service/impl/CheckoutServiceImpl.java index 0a6d2dde..192c5e47 100644 --- a/src/com/platform/service/impl/CheckoutServiceImpl.java +++ b/src/com/platform/service/impl/CheckoutServiceImpl.java @@ -1,22 +1,29 @@ package com.platform.service.impl; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Calendar; +import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; +import org.springframework.stereotype.Service; + import com.platform.dao.DataInfoDao; import com.platform.dao.PreDataInfoDao; import com.platform.entities.CheckoutEntity; import com.platform.entities.DataInfoEntity; import com.platform.entities.PreDataInfo; -import com.platform.service.CheckoutService; +import com.platform.service.ICheckoutService; import com.platform.utils.BeanCopy; import com.platform.utils.DateForm; -public class CheckoutServiceImpl implements CheckoutService { +@Service(value = "checkoutService") +public class CheckoutServiceImpl implements ICheckoutService { @Resource(name = "preDataInfoDao") private PreDataInfoDao preDataInfoDao; @@ -25,7 +32,8 @@ public class CheckoutServiceImpl implements CheckoutService { private DataInfoDao dataInfoDao; @Override - public List findAll() throws Exception { + public List findAll() throws Exception { + List checks = new ArrayList(); List result = preDataInfoDao.findAllCollect(); DataInfoEntity data = new DataInfoEntity(); Calendar c2 = Calendar.getInstance(); @@ -50,19 +58,56 @@ public class CheckoutServiceImpl implements CheckoutService { String key = pre.getAreaCode().toLowerCase()+"_"+ pre.getSysCode(); DataInfoEntity dataInfo = dataMap.get(key); CheckoutEntity ck = new CheckoutEntity(); - BeanCopy.copyField(pre, ck); - String pay = dataInfo.getPayResult(); - String exec = dataInfo.getExecResult(); - ck.setPayResult(pay); - ck.setExecResult(exec); - ck.setCheckResult(isY(pay,exec)); + BeanCopy.copyBean(pre, ck); + if (null != dataInfo) { + String pay = dataInfo.getPayResult(); + String exec = dataInfo.getExecResult(); + ck.setPayResult(isY(pay)); + ck.setExecResult(isY(exec)); + ck.setCheckResult(isY(pay,exec)); + } + else { + ck.setPayResult(isY(null)); + ck.setExecResult(isY(null)); + ck.setCheckResult(isY(null)); + ck.setCollection("否"); + } + checks.add(ck); } - return result; + //排序 按 checkResult 排序 + Collections.sort(checks); + return checks; } @Override - public void checkAll() { - + public List checkAll(List list) throws Exception { + List result = new ArrayList(); + if (list.size() > 0) { + result = findByCity(list.get(0).getCityName()); + } + Map map = new HashMap(); + for (CheckoutEntity checkoutEntity : list) { + checkOne(checkoutEntity); + map.put(checkoutEntity.getAreaCode()+ "_" +checkoutEntity.getSysCode()+ "_" +checkoutEntity.getDataVersion(),checkoutEntity); + } + for (int i = 0; i < result.size(); i++) { + CheckoutEntity checkoutEntity = result.get(i); + String area_sys = checkoutEntity.getAreaCode()+ "_" +checkoutEntity.getSysCode()+ "_" +checkoutEntity.getDataVersion(); + if (map.containsKey(area_sys)) { + result.set(i, map.get(area_sys)); + } + } +// for (CheckoutEntity checkoutEntity : list) { +// DataInfoEntity data = new DataInfoEntity(); +// checkOne(checkoutEntity); +// data.setId(checkoutEntity.getDataId()); +// data.setPayResultLast(checkoutEntity.getPayResultLast()); +// data.setExecResultLast(checkoutEntity.getExecResultLast()); +// data.setCheckoutFlag(checkoutEntity.getCheckoutFlag()); +// dataInfoDao.update(data); +// } + + return result; } private int getMonBeforeHalfYear(int num){ @@ -74,11 +119,214 @@ public class CheckoutServiceImpl implements CheckoutService { } private String isY(String str1, String str2) { - String r = "n"; + String r = "否"; if (null !=str2 && null !=str1 && str1.equals(str2) && "y".equals(str1.toLowerCase())) { - r = "y"; + r = "是"; + } + return r; + } + private String isY(String str1) { + if (null != str1 && "y".equals(str1.toLowerCase())) { + return "是"; + } + else { + return "否"; + } + } + + /** 校验 + * @param ck + * @return + */ + private CheckoutEntity checkOne(CheckoutEntity ck) { + String pay = ck.getPayResult(); + String exec = ck.getExecResult(); + ck.setPayResultLast(isY(pay)); + ck.setExecResultLast(isY(exec)); + ck.setCheckResult(isY(pay, exec)); + // 1:已校验 + ck.setCheckoutFlag("1"); + return ck; + } + + @Override + public List findByCity(String city) throws Exception { + CheckoutEntity cksql = new CheckoutEntity(); + Calendar c2 = Calendar.getInstance(); + // 时间设置为 半年前的时间 + c2.set(Calendar.MONTH, getMonBeforeHalfYear(c2.get(Calendar.MONTH))); + String time = DateForm.date2StringByDay(c2.getTime()); + cksql.setCollectingTime(time); + cksql.setCityName(city); + + List resul = new ArrayList(); + List list = preDataInfoDao.findByCity(cksql); + int length = list.size(); + for (int i = 0; i < length; i++) { + CheckoutEntity preDataInfo = list.get(i); + if (null != preDataInfo.getPayResultLast() && + preDataInfo.getPayResultLast().equals(preDataInfo.getExecResultLast()) && + "是".equals(preDataInfo.getExecResultLast())) { + preDataInfo.setCheckResult("是"); + }else if(null != preDataInfo.getPayResultLast() && null != preDataInfo.getExecResultLast() && !"-".equals(preDataInfo.getPayResultLast()) && !"-".equals(preDataInfo.getExecResultLast())){ + preDataInfo.setCheckResult("否"); + } + preDataInfo.setId(i); + preDataInfo.setCollUpdate(isY(preDataInfo.getCollUpdate())); + if (preDataInfo.getDataVersion() < 1) { + preDataInfo.setCollection("否"); + } + if (null != preDataInfo.getCollectingTime()) { + if (c2.getTime().before(DateForm.string2DateByDay(preDataInfo.getCollectingTime()))) { + resul.add(preDataInfo); + } + } + else{ + resul.add(preDataInfo); + } + } + return resul; + } + + @Override + public int updateStandardInfo(PreDataInfo ck) throws Exception { + ck.setProper(); + String areaCode = ck.getAreaCode(); + int sysCode = ck.getSysCode(); + //对比字段 -- 采集描述的 更新字段是否 改为不更新 + PreDataInfo data = new CheckoutEntity(); + data.setAreaCode(areaCode); + data.setSysCode(sysCode); + PreDataInfo data2 = preDataInfoDao.findLastByCode(data); + data2.setCollUpdate("n"); + //对比 : + if (checkField(ck, data2) && checkWorkRange(ck, data2)) { + preDataInfoDao.updateCollection(data2); } + + int r = preDataInfoDao.update(ck); return r; } + @Override + public Map findDetail(CheckoutEntity ck) + throws Exception { + Map map = new HashMap(); + PreDataInfo data = new CheckoutEntity(); + String areaCode = ck.getAreaCode(); + int sysCode = ck.getSysCode(); + data.setAreaCode(areaCode); + data.setSysCode(sysCode); + PreDataInfo data1 = preDataInfoDao.findStandardByCode(data); + data1.reSetWorkRange(new ArrayList()); + map.put("data1", data1); + + data.setAreaCode(areaCode); + data.setSysCode(sysCode); + PreDataInfo data2 = preDataInfoDao.findLastByCode(data); + // 对比字段 + if (data1.getFunctionDetails().equals(data2.getFunctionDetails())) { + data2.setFunctionDetails(""); + } + if (data1.getAreaLevel().equals(data2.getAreaLevel())) { + data2.setAreaLevel(""); + } + if (data1.getBeginUseTime().equals(data2.getBeginUseTime())) { + data2.setBeginUseTime(""); + } + if (data1.getDataBaseType().equals(data2.getDataBaseType())) { + data2.setDataBaseType(""); + } + if (data1.getDataBaseVersion().equals(data2.getDataBaseVersion())) { + data2.setDataBaseVersion(""); + } + if (data1.getDeveloperFullName().equals(data2.getDeveloperFullName())) { + data2.setDeveloperFullName(""); + } + if (data1.getDepartmentManager().equals(data2.getDepartmentManager())) { + data2.setDepartmentManager(""); + } + if (data1.getManagerContacts().equals(data2.getManagerContacts())) { + data2.setManagerContacts(""); + } + if (data1.getSysVersion().equals(data2.getSysVersion())) { + data2.setSysVersion(""); + } + if(!checkWorkRange(data1, data2)){ + data2.reSetWorkRange(null); + } + map.put("data2", data2); + return map; + } + + /** true 系统所属范围没变化,false:系统范围改变 + * @param data1 + * @param data2 + * @return + */ + private boolean checkWorkRange(PreDataInfo data1, PreDataInfo data2) { + if (!data1.getDepartmentBudgetManage().equals(data2.getDepartmentBudgetManage())) { + return false; + } + if (!data1.getBudgetQuotaManage().equals(data2.getBudgetQuotaManage())) { + return false; + } + if (!data1.getBudgetExecManage().equals(data2.getBudgetExecManage())) { + return false; + } + if (!data1.getTotalBudgetAccount().equals(data2.getTotalBudgetAccount())) { + return false; + } + if (!data1.getFinalAccountManage().equals(data2.getFinalAccountManage())) { + return false; + } + if (!data1.getReportFormManage().equals(data2.getReportFormManage())) { + return false; + } + if (!data1.getNonTaxManage().equals(data2.getNonTaxManage())) { + return false; + } + if (!data1.getWageSystem().equals(data2.getWageSystem())) { + return false; + } + if (!data1.getAnalysisOfFinancialEconomicProsperity().equals(data2.getAnalysisOfFinancialEconomicProsperity())) { + return false; + } + if (!data1.getGovernmentDebtManage().equals(data2.getGovernmentDebtManage())) { + return false; + } + + return true; + } + + private boolean checkField(PreDataInfo data1, PreDataInfo data2) { + if (!data1.getFunctionDetails().equals(data2.getFunctionDetails())) { + return false; + } + if (!data1.getAreaLevel().equals(data2.getAreaLevel())) { + return false; + } + if (!data1.getBeginUseTime().equals(data2.getBeginUseTime())) { + return false; + } + if (!data1.getDataBaseType().equals(data2.getDataBaseType())) { + return false; + } + if (!data1.getDataBaseVersion().equals(data2.getDataBaseVersion())) { + return false; + } + if (!data1.getDeveloperFullName().equals(data2.getDeveloperFullName())) { + return false; + } + if (!data1.getDepartmentManager().equals(data2.getDepartmentManager())) { + return false; + } + if (!data1.getManagerContacts().equals(data2.getManagerContacts())) { + return false; + } + if (!data1.getSysVersion().equals(data2.getSysVersion())) { + return false; + } + return true; + } } diff --git a/src/com/platform/service/impl/PreDataInfoServiceImpl.java b/src/com/platform/service/impl/PreDataInfoServiceImpl.java index 76a3b4a7..293193a5 100644 --- a/src/com/platform/service/impl/PreDataInfoServiceImpl.java +++ b/src/com/platform/service/impl/PreDataInfoServiceImpl.java @@ -52,7 +52,7 @@ public class PreDataInfoServiceImpl implements IPreDataInfoService { Configs.SQL_SCRIPT_PATH_STANDARD); setScript(result, sqlFilePathsStandard); for (PreDataInfo preDataInfo : result) { - preDataInfo.setWorkRange(new ArrayList()); + preDataInfo.reSetWorkRange(new ArrayList()); preDataInfo.setSqlList(new ArrayList()); } return result; @@ -106,7 +106,7 @@ public class PreDataInfoServiceImpl implements IPreDataInfoService { try { PreDataInfo pre = new PreDataInfo(); //excel数据 --> java bean - List subPreData = ExcelOperation.readExcel4Update(workbook, Constant.EXCEL_TEMPLATE_INIT_ROW, 0, pre, "id", "workRange","sysCode","updateTime","userTablespaceStatus", "checkoutIndicateStatus", "checkoutPayStatus", "userTablespacePath", "checkoutIndicatePath", "checkoutPayPath", "sqlList"); + List subPreData = ExcelOperation.readExcel4Update(workbook, Constant.EXCEL_TEMPLATE_INIT_ROW, 0, pre, "id", "workRange","sysCode","updateTime","userTablespaceStatus", "checkoutIndicateStatus", "checkoutPayStatus", "userTablespacePath", "checkoutIndicatePath", "checkoutPayPath", "sqlList", "dataVersion", "collectingTime", "collUpdate"); if (null != subPreData && subPreData.size() > 0) { //是否是 同一个县区的 系统--是则 加入 boolean isSameArea = true; @@ -263,7 +263,7 @@ public class PreDataInfoServiceImpl implements IPreDataInfoService { XSSFWorkbook result = null; try { workbook = new XSSFWorkbook(res.getInputStream()); - result = ExcelOperation.writeExcelTemplate(workbook, Constant.EXCEL_TEMPLATE_INIT_ROW, 0, 25, list, "id", "workRange","sysCode","updateTime","userTablespaceStatus", "checkoutIndicateStatus", "checkoutPayStatus", "userTablespacePath", "checkoutIndicatePath", "checkoutPayPath", "sqlList"); + result = ExcelOperation.writeExcelTemplate(workbook, Constant.EXCEL_TEMPLATE_INIT_ROW, 0, 25, list, "id", "workRange","sysCode","updateTime","userTablespaceStatus", "checkoutIndicateStatus", "checkoutPayStatus", "userTablespacePath", "checkoutIndicatePath", "checkoutPayPath", "sqlList", "dataVersion", "collectingTime", "collUpdate"); } catch (IllegalArgumentException | IllegalAccessException | IOException e) { errList.add(e.getMessage()); diff --git a/src/com/platform/service/impl/ScriptMakeService.java b/src/com/platform/service/impl/ScriptMakeService.java index 575be38b..266669c7 100644 --- a/src/com/platform/service/impl/ScriptMakeService.java +++ b/src/com/platform/service/impl/ScriptMakeService.java @@ -1,5 +1,6 @@ package com.platform.service.impl; +import java.beans.IntrospectionException; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -96,14 +97,14 @@ public class ScriptMakeService implements IScriptMakeService { XmlOperationByDom4j .createXml(FileOperateHelper.addLastSeparator(areaPath) - + key + ".xml", defList, "Data_info", "workRange"); + + key + ".xml", defList, "Data_info", "id", "workRange","sysCode","updateTime","userTablespaceStatus", "checkoutIndicateStatus", "checkoutPayStatus", "userTablespacePath", "checkoutIndicatePath", "checkoutPayPath", "sqlList", "dataVersion", "collectingTime", "collUpdate"); } log.info("makeXml--end"); return 1; } @Override - public List FindAllFiles() throws Exception { + public List findAllFiles() throws Exception { List systemDataInfo = preDataInfoDao.findAll(); // 查找 Configs.SQL_SCRIPT_PATH_LAST 路径下的 所有的文件:路径 Map sqlFilePathsLast = new HashMap(); @@ -317,12 +318,14 @@ public class ScriptMakeService implements IScriptMakeService { myfile, ".sql"); myfile.setCkPayScriptPathLast(payPathLast); // 设置 状态 - if ("ORACLE".equals(myfile.getDataBaseType().toUpperCase())) { - myfile.setUserTableStatus(getStatus( - myfile.getUserTableScriptPathStandard(), - myfile.getUserTableScriptPathLast())); - } else { - myfile.setUserTableStatus(4); + if (null != myfile.getDataBaseType()) { + if ("ORACLE".equals(myfile.getDataBaseType().toUpperCase())) { + myfile.setUserTableStatus(getStatus( + myfile.getUserTableScriptPathStandard(), + myfile.getUserTableScriptPathLast())); + } else { + myfile.setUserTableStatus(4); + } } myfile.setCkIndicateStatus(getStatus( myfile.getCkIndicateScriptPathStandard(), diff --git a/src/com/platform/utils/BeanCopy.java b/src/com/platform/utils/BeanCopy.java index d992c602..c883309f 100644 --- a/src/com/platform/utils/BeanCopy.java +++ b/src/com/platform/utils/BeanCopy.java @@ -1,5 +1,9 @@ package com.platform.utils; +import java.beans.BeanInfo; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -26,7 +30,7 @@ public class BeanCopy { * @throws NoSuchFieldException * @throws SecurityException */ - public static void copyBean(Object source, Object dst, String... params){ + public static synchronized void copyBean(Object source, Object dst, String... params){ if (dst.getClass().getSuperclass() == source.getClass()) { fatherCopyChild(source, dst, params); } @@ -63,7 +67,37 @@ public class BeanCopy { } - public static void copyField(Object src, Object dst,String... filter) { + public static synchronized void copyField(Object src, Object dst,String... filter) throws IntrospectionException { + List filters = Arrays.asList(filter); + BeanInfo dstBeanInfo = Introspector.getBeanInfo(dst.getClass()); // 获取类属性 +// Object obj = type.newInstance(); // 创建 JavaBean 对象 + BeanInfo srcBeanInfo = Introspector.getBeanInfo(src.getClass()); // 获取类属性 + PropertyDescriptor[] srcPropertyDescriptors = srcBeanInfo.getPropertyDescriptors(); + for (PropertyDescriptor property : srcPropertyDescriptors) { + String pName = property.getName(); + if (filters.contains(pName)) { + continue; + } + if (!"class".equals(pName)) { + Method readMethod = property.getReadMethod(); + try { + Object result = readMethod.invoke(src, new Object[0]); + if (null == result) { + continue; + } + property.getWriteMethod().invoke(dst, new Object[]{result}); + } catch (IllegalAccessException e) { + log.error(pName + " Access is false : AccessException"); + } catch (IllegalArgumentException e) { + log.error(pName + " is inexist or null or OutOfRange : ArgumentException "); + } catch (InvocationTargetException e) { + log.error(pName + " is Invocation Exception"); + } + } + } + } + + public static synchronized void copyFieldERR(Object src, Object dst,String... filter) { List filters = Arrays.asList(filter); List fields = new ArrayList(); Class classobj = src.getClass(); @@ -76,18 +110,27 @@ public class BeanCopy { fields = findFatherField(classobj, fields); } for (Field field : fields) { - if (filters.contains(field.getName())) { + String name = field.getName(); + if (filters.contains(name)) { continue; } // dst obj's property set value try { - field.set(dst, field.get(src)); + Method m = src.getClass().getMethod("get"+upperHeadChar(name)); + Object value = m.invoke(src); + if (null != value) + field.set(dst, value); +// field.set(dst, field.get(src)); } catch (SecurityException e) { log.error(field.getName() + " is unsafe : SecurityException"); } catch (IllegalArgumentException e) { log.error(field.getName() + " is inexist or null or OutOfRange : ArgumentException "); } catch (IllegalAccessException e) { log.error(field.getName() + " Access is false : AccessException"); + } catch (NoSuchMethodException e) { + log.error(e.getMessage()); + } catch (InvocationTargetException e) { + log.error(e.getMessage()); } } }