feat(validate report): validation view show if there is error

master
yixian 5 years ago
parent 804fc0c9e8
commit a9ee640f81

@ -4,7 +4,6 @@ import au.com.royalpay.payment.manage.support.abafile.ABAFile;
import au.com.royalpay.payment.manage.tradelog.beans.ClearingLogQuery;
import com.alibaba.fastjson.JSONObject;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.InputStreamResource;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
@ -21,7 +20,7 @@ import java.util.Map;
*/
public interface CleanService {
List<String> listValidatedDays(Date month);
List<JSONObject> listValidatedDays(Date month);
List<JSONObject> listClientCleanLogsForMonth(Date date, int clientId);

@ -159,13 +159,17 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
// private final String[] open_ids = { "o32MzuO4s8c7iFOVxnxejkbhMoEc" };
@Override
public List<String> listValidatedDays(Date month) {
List<Date> dates = validationLogMapper.listValidatedDates(month);
List<String> dateString = new ArrayList<>();
for (Date date : dates) {
dateString.add(DateFormatUtils.format(date, "yyyy/MM/dd"));
}
return dateString;
public List<JSONObject> listValidatedDays(Date month) {
List<JSONObject> reports = validationLogMapper.listValidatedReports(month);
List<JSONObject> topReports = new ArrayList<>();
for (JSONObject report : reports) {
JSONObject item = new JSONObject();
item.put("date", DateFormatUtils.format(item.getDate("valid_date"), "yyyy/MM/dd"));
JSONObject result = JSON.parseObject(report.getString("result"));
item.put("success", result.getBooleanValue("valid"));
topReports.add(item);
}
return topReports;
}
@Override

@ -29,7 +29,7 @@ public class FinancialController {
private CleanService cleanService;
@GetMapping("/validated_dates/{month}")
public List<String> listMonthValidatedDays(@PathVariable String month) {
public List<JSONObject> listMonthValidatedDays(@PathVariable String month) {
try {
Date mon = DateUtils.parseDate(month, new String[]{"yyyyMM"});
return cleanService.listValidatedDays(mon);

@ -23,5 +23,5 @@ public interface ValidationLogMapper {
JSONObject findByDate(@Param("valid_date") Date validDate);
List<Date> listValidatedDates(@Param("month") Date month);
List<JSONObject> listValidatedReports(@Param("month") Date month);
}

@ -7,7 +7,7 @@
<select id="findByDate" resultType="com.alibaba.fastjson.JSONObject">
SELECT * FROM log_order_validation WHERE valid_date=date(#{valid_date})
</select>
<select id="listValidatedDates" resultType="java.util.Date">
SELECT valid_date FROM log_order_validation WHERE month(valid_date)=month(#{month}) and year(valid_date)=year(#{month})
<select id="listValidatedReports" resultType="com.alibaba.fastjson.JSONObject">
SELECT valid_date,result FROM log_order_validation WHERE month(valid_date)=month(#{month}) and year(valid_date)=year(#{month})
</select>
</mapper>

@ -58,7 +58,7 @@
</button>
<button class="btn btn-default" ng-repeat="log in detail.logs"
ng-click="switchSettleBatch(log)"
ng-class="{active:analysisFilter.clearing_id==log.clearing_id}">
ng-class="{active:analysisFilter.clearing_id==log.clearing_id,'text-red':log.balance!=0}">
<i class="fa fa-lock" ng-if="!log.editable"></i>
<span ng-bind="'['+(log.plan_detail.remark||log.plan_detail.plan_id)+']'+log.operate_time"></span>
</button>

@ -18,10 +18,14 @@ define(['angular', 'uiRouter'], function () {
app.controller('orderValidCalendarCtrl', ['$scope', '$http', '$filter', function ($scope, $http, $filter) {
$scope.today = new Date();
$scope.loadValidatedDates = function (month) {
var monthStr = $filter('date')(month, 'yyyyMM');
let monthStr = $filter('date')(month, 'yyyyMM');
$http.get('/sys/financial/validated_dates/' + monthStr).then(function (resp) {
$scope.validatedDates = resp.data;
})
};
$scope.findReport = function (dateStr) {
let filtered = $scope.validatedDates.filter(rp => rp.date === dateStr);
return filtered.length ? filtered[0] : null
}
}]);
app.controller('orderValidationCtrl', ['$scope', '$http', '$filter', '$stateParams', 'commonDialog',

@ -12,7 +12,8 @@
<div class="box-body">
<div royal-calendar month-change="loadValidatedDates($month)">
<a class="rc-full" role="button" ui-sref=".report({date:(day|date:'yyyyMMdd')})" style="font-size: 40px" ng-if="day<=today">
<i class="fa fa-check-circle text-green" ng-if="validatedDates.indexOf((day|date:'yyyy/MM/dd'))>=0"></i>
<i class="fa" ng-class="{'fa-check-circle text-green':findReport((day|date:'yyyy/MM/dd')).success,'fa-warning text-red':!findReport((day|date:'yyyy/MM/dd')).success}"
ng-if="findReport((day|date:'yyyy/MM/dd'))!=null"></i>
</a>
</div>
</div>

Loading…
Cancel
Save