Commit 7188f079 authored by liuna's avatar liuna

2017年12月27日 --智能分析平台

--删除规则改为物理删除、质量报告时间精确到日
parent 11fb1a8f
...@@ -45,6 +45,9 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>, ...@@ -45,6 +45,9 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>,
@Query("select count(*) from QualityRule qualityRule where qualityRule.qualityRuleId=:qualityRuleId") @Query("select count(*) from QualityRule qualityRule where qualityRule.qualityRuleId=:qualityRuleId")
Long getNumOfQualityRuleByQualityRuleId(@Param("qualityRuleId")String qualityRuleId); Long getNumOfQualityRuleByQualityRuleId(@Param("qualityRuleId")String qualityRuleId);
//根据质量规则批量修改
@Modifying
@Query("update from QualityRule qr set qr.ruleValidFlag =:ruleValidFlag where qr.qualityRuleId in (:qualityRuleId)")
void updateRuleValidFlagByQualityRuleId(@Param("ruleValidFlag") String ruleValidFlag,@Param("qualityRuleId")List<Long> qualityRuleId);
} }
...@@ -168,18 +168,25 @@ public class QualityRuleResultController { ...@@ -168,18 +168,25 @@ public class QualityRuleResultController {
List<QualityRule> qualityRuleList = new ArrayList<QualityRule>(); List<QualityRule> qualityRuleList = new ArrayList<QualityRule>();
List<AccuracyRule> accuracyRuleList = new ArrayList<AccuracyRule>(); List<AccuracyRule> accuracyRuleList = new ArrayList<AccuracyRule>();
QualityRule qualityRule = null;
if(qualityRuleId.contains(",")){ if(qualityRuleId.contains(",")){
String [] qualityRules = qualityRuleId.split(","); String [] qualityRules = qualityRuleId.split(",");
for (String s : qualityRules) { for (String s : qualityRules) {
qualityRuleList.add(qualityRuleDao.findByQualityRuleId(Long.parseLong(s))); qualityRuleList.add(qualityRuleDao.findByQualityRuleId(Long.parseLong(s)));
accuracyRuleList = accuracyRuleDao.findByQualityRuleId(Long.parseLong(s)); accuracyRuleList = accuracyRuleDao.findByQualityRuleId(Long.parseLong(s));
qualityRule = qualityRuleDao.findByQualityRuleId(Long.parseLong(s));
qualityRule.setRuleValidFlag("0");
} }
}else{ }else{
qualityRuleList.add(qualityRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId))); qualityRuleList.add(qualityRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId)));
qualityRule = qualityRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
qualityRule.setRuleValidFlag("0");
} }
qualityRuleDao.delete(qualityRuleList); qualityRuleDao.save(qualityRule);
accuracyRuleDao.delete(accuracyRuleList);
// qualityRuleDao.delete(qualityRuleList);
// accuracyRuleDao.delete(accuracyRuleList);
cmszOperationLogService.createLog("删除","更新质量规则","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+qualityRuleId); cmszOperationLogService.createLog("删除","更新质量规则","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+qualityRuleId);
return PageURLController.RuleResult; return PageURLController.RuleResult;
......
...@@ -118,6 +118,9 @@ SimpleDateFormat.prototype.applyPattern=function(pattern){ ...@@ -118,6 +118,9 @@ SimpleDateFormat.prototype.applyPattern=function(pattern){
var df=new SimpleDateFormat(); var df=new SimpleDateFormat();
df.applyPattern("yyyy-MM-dd HH:mm:ss"); df.applyPattern("yyyy-MM-dd HH:mm:ss");
var sdf=new SimpleDateFormat();
sdf.applyPattern("yyyy-MM-dd");
// //
var ruleReportId; var ruleReportId;
function ruleReportDetailTable(){ function ruleReportDetailTable(){
...@@ -326,7 +329,7 @@ table_pagging.prototype = { ...@@ -326,7 +329,7 @@ table_pagging.prototype = {
if(k==15){ if(k==15){
if(tdContext!="&nbsp;"){ if(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext)); tdContext = sdf.format(new Date(tdContext));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment