Commit de7d4bd972ec15522bbda7462e4d4e3c047626cf
1 parent
514bdc5a
Exists in
master
资金日报
Showing
12 changed files
with
744 additions
and
7 deletions
Show diff stats
backend/chkpower/src/main/java/com/hotent/chkpower/controller/WCurrentController.java
... | ... | @@ -84,7 +84,7 @@ public class WCurrentController extends BaseController<WCurrentManager, WCurrent |
84 | 84 | List<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>(); |
85 | 85 | BigDecimal hz = new BigDecimal(0.00); |
86 | 86 | for (String orgType : gslxList) { |
87 | - List<HashMap<String, String>> listData = baseService.getCurrentAccountBalanceList(orgType, date + " 00:00:00"); | |
87 | + List<HashMap<String, String>> listData = baseService.getCurrentAccountBalanceList(orgType, date); | |
88 | 88 | BigDecimal totalBalance = listData.stream() |
89 | 89 | .filter(d -> d.containsKey("F_account_balance")) // 确保键存在 |
90 | 90 | .map(d -> { | ... | ... |
backend/chkpower/src/main/java/com/hotent/chkpower/controller/WDailyFundsController.java
0 → 100644
... | ... | @@ -0,0 +1,56 @@ |
1 | +package com.hotent.chkpower.controller; | |
2 | + | |
3 | + | |
4 | +import org.springframework.web.bind.annotation.GetMapping; | |
5 | +import org.springframework.web.bind.annotation.PostMapping; | |
6 | +import org.springframework.web.bind.annotation.RequestBody; | |
7 | +import org.springframework.web.bind.annotation.RequestMapping; | |
8 | +import org.springframework.web.bind.annotation.RequestParam; | |
9 | +import com.hotent.base.model.CommonResult; | |
10 | +import com.hotent.base.util.StringUtil; | |
11 | +import io.swagger.annotations.ApiOperation; | |
12 | +import io.swagger.annotations.ApiParam; | |
13 | +import org.springframework.web.bind.annotation.RestController; | |
14 | +import com.hotent.base.controller.BaseController; | |
15 | +import com.hotent.chkpower.model.WDailyFunds; | |
16 | +import com.hotent.chkpower.manager.WDailyFundsManager; | |
17 | + | |
18 | +/** | |
19 | + * 每日资金 前端控制器 | |
20 | + * | |
21 | + * @company 广州宏天软件股份有限公司 | |
22 | + * @author cw | |
23 | + * @since 2024-07-08 | |
24 | + */ | |
25 | +@RestController | |
26 | +@RequestMapping("/wDailyFunds/v1/") | |
27 | +public class WDailyFundsController extends BaseController<WDailyFundsManager, WDailyFunds> { | |
28 | + | |
29 | + /** | |
30 | + * 根据id获取每日资金数据详情 | |
31 | + * @param id | |
32 | + * @return | |
33 | + * @throws Exception | |
34 | + * ModelAndView | |
35 | + */ | |
36 | + @GetMapping(value="/getDetail") | |
37 | + @ApiOperation(value="根据id获取每日资金数据详情",httpMethod = "GET",notes = "根据id获取每日资金数据详情") | |
38 | + public CommonResult<WDailyFunds> getDetail(@ApiParam(name="id",value="业务对象主键", required = true)@RequestParam(required=true) String id) throws Exception{ | |
39 | + return CommonResult.<WDailyFunds>ok().value(baseService.getDetail(id)); | |
40 | + } | |
41 | + /** | |
42 | + * 新增,更新每日资金 | |
43 | + * @param wDailyFunds | |
44 | + * @throws Exception | |
45 | + * @return | |
46 | + * @exception | |
47 | + */ | |
48 | + @PostMapping(value="/save") | |
49 | + @ApiOperation(value = "新增,更新每日资金数据", httpMethod = "POST", notes = "新增,更新每日资金数据") | |
50 | + public CommonResult<String> save(@ApiParam(name="WDailyFunds",value="每日资金对象", required = true)@RequestBody WDailyFunds wDailyFunds) throws Exception{ | |
51 | + String msg = StringUtil.isEmpty(wDailyFunds.getId()) ? "添加每日资金成功" : "更新每日资金成功"; | |
52 | + baseService.createOrUpdate(wDailyFunds); | |
53 | + return CommonResult.<String>ok().message(msg); | |
54 | + } | |
55 | + | |
56 | +} | ... | ... |
backend/chkpower/src/main/java/com/hotent/chkpower/controller/WFinanceController.java
... | ... | @@ -92,7 +92,7 @@ public class WFinanceController extends BaseController<WFinanceManager, WFinance |
92 | 92 | BigDecimal F_total_net_cash_flow_zh = new BigDecimal(0.00); |
93 | 93 | int Serial_Number=1; |
94 | 94 | for (String orgType : gslxList) { |
95 | - List<HashMap<String, String>> listData = baseService.getTransactionDetailsList(orgType, date + " 00:00:00"); | |
95 | + List<HashMap<String, String>> listData = baseService.getTransactionDetailsList(orgType, date); | |
96 | 96 | if (listData != null && listData.size() > 0) { |
97 | 97 | for (HashMap<String, String> datum : listData) { |
98 | 98 | datum.put("Serial_Number",String.valueOf(Serial_Number++)); | ... | ... |
backend/chkpower/src/main/java/com/hotent/chkpower/dao/WDailyFundsDao.java
0 → 100644
... | ... | @@ -0,0 +1,30 @@ |
1 | +package com.hotent.chkpower.dao; | |
2 | + | |
3 | +import com.hotent.chkpower.model.WCurrent; | |
4 | +import com.hotent.chkpower.model.WDailyFunds; | |
5 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
6 | +import org.apache.ibatis.annotations.Param; | |
7 | + | |
8 | +import java.time.LocalDateTime; | |
9 | +import java.util.HashMap; | |
10 | +import java.util.List; | |
11 | + | |
12 | +/** | |
13 | + * 每日资金 Mapper 接口 | |
14 | + * | |
15 | + * @company 广州宏天软件股份有限公司 | |
16 | + * @author cw | |
17 | + * @since 2024-07-08 | |
18 | + */ | |
19 | +public interface WDailyFundsDao extends BaseMapper<WDailyFunds> { | |
20 | + | |
21 | + | |
22 | + void insertInitWDailyFunds(@Param("fDate") LocalDateTime fDate); | |
23 | + | |
24 | + | |
25 | + Integer selectWDailyFundsCount(@Param("fDate") LocalDateTime fDate); | |
26 | + | |
27 | + | |
28 | + List<WDailyFunds> selectWDailyFundsNews(@Param("wCurrentList") List<HashMap<String,String>> wCurrentList, @Param("fDate") LocalDateTime fDate); | |
29 | + | |
30 | +} | ... | ... |
backend/chkpower/src/main/java/com/hotent/chkpower/manager/WAfterScriptManager.java
backend/chkpower/src/main/java/com/hotent/chkpower/manager/WDailyFundsManager.java
0 → 100644
... | ... | @@ -0,0 +1,39 @@ |
1 | +package com.hotent.chkpower.manager; | |
2 | + | |
3 | +import com.hotent.chkpower.model.WCurrent; | |
4 | +import com.hotent.chkpower.model.WDailyFunds; | |
5 | +import com.hotent.base.manager.BaseManager; | |
6 | + | |
7 | +import java.time.LocalDateTime; | |
8 | +import java.util.HashMap; | |
9 | +import java.util.List; | |
10 | +import java.util.Map; | |
11 | + | |
12 | +/** | |
13 | + * 每日资金 服务类 | |
14 | + * | |
15 | + * @company 广州宏天软件股份有限公司 | |
16 | + * @author cw | |
17 | + * @since 2024-07-08 | |
18 | + */ | |
19 | +public interface WDailyFundsManager extends BaseManager<WDailyFunds> { | |
20 | + /** | |
21 | + * 根据主键获取详情 | |
22 | + * @param id | |
23 | + * @return | |
24 | + */ | |
25 | + WDailyFunds getDetail(String id); | |
26 | + /** | |
27 | + * 新建、更新每日资金 | |
28 | + * @param wDailyFunds | |
29 | + * @return | |
30 | + */ | |
31 | + void createOrUpdate(WDailyFunds wDailyFunds); | |
32 | + | |
33 | + | |
34 | + | |
35 | + | |
36 | + void editWDailyFunds(List<HashMap<String,String>> wCurrentList, LocalDateTime date); | |
37 | + | |
38 | + | |
39 | +} | ... | ... |
backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WAfterScriptManagerImpl.java
1 | 1 | package com.hotent.chkpower.manager.impl; |
2 | 2 | |
3 | +import com.google.gson.Gson; | |
4 | +import com.google.gson.reflect.TypeToken; | |
3 | 5 | import com.hotent.chkpower.manager.WAfterScriptManager; |
6 | +import com.hotent.chkpower.manager.WDailyFundsManager; | |
7 | +import com.hotent.chkpower.model.WCurrent; | |
4 | 8 | import lombok.AllArgsConstructor; |
5 | 9 | import lombok.extern.slf4j.Slf4j; |
10 | +import org.activiti.engine.impl.util.json.JSONObject; | |
11 | +import org.springframework.beans.factory.annotation.Autowired; | |
6 | 12 | import org.springframework.stereotype.Service; |
7 | 13 | import org.springframework.transaction.annotation.Transactional; |
8 | 14 | |
15 | +import javax.annotation.Resource; | |
16 | +import java.lang.reflect.Type; | |
17 | +import java.time.LocalDate; | |
18 | +import java.time.LocalDateTime; | |
19 | +import java.time.LocalTime; | |
20 | +import java.time.format.DateTimeFormatter; | |
21 | +import java.util.ArrayList; | |
22 | +import java.util.HashMap; | |
23 | +import java.util.List; | |
9 | 24 | import java.util.Map; |
10 | 25 | |
11 | 26 | @Service |
... | ... | @@ -13,10 +28,39 @@ import java.util.Map; |
13 | 28 | @Slf4j |
14 | 29 | @Transactional |
15 | 30 | public class WAfterScriptManagerImpl implements WAfterScriptManager { |
31 | + @Resource | |
32 | + private WDailyFundsManager wDailyFundsManager; | |
16 | 33 | |
17 | 34 | |
18 | 35 | @Override |
19 | - public void editCurrent(Map map) { | |
20 | - System.out.println(map); | |
36 | + public void editCurrentReport(Map map) { | |
37 | + LocalDateTime date = convertStringToLocalDateTime(map.get("date").toString()); | |
38 | + String json = map.get("subMap").toString(); | |
39 | + // 将 JSON 字符串转换为 JSONObject | |
40 | + JSONObject jsonObject = new JSONObject(json); | |
41 | + String currentDetail = String.valueOf(jsonObject.get("current_detail")); | |
42 | + Gson gson = new Gson(); | |
43 | + List<HashMap<String,String>> wCurrentList = gson.fromJson(currentDetail, List.class); | |
44 | + wDailyFundsManager.editWDailyFunds(wCurrentList, date); | |
45 | + } | |
46 | + | |
47 | + @Override | |
48 | + public void editFinance(Map map) { | |
49 | + LocalDateTime date = convertStringToLocalDateTime(map.get("date").toString()); | |
50 | + HashMap<String, String> stringStringHashMap = new HashMap<>(); | |
51 | + stringStringHashMap.put("F_org_id",String.valueOf(map.get("org_id"))); | |
52 | + List<HashMap<String,String>> list= new ArrayList<HashMap<String,String>>(); | |
53 | + list.add(stringStringHashMap); | |
54 | + wDailyFundsManager.editWDailyFunds(list, date); | |
55 | + } | |
56 | + | |
57 | + | |
58 | + private static LocalDateTime convertStringToLocalDateTime(String dateString) { | |
59 | + String datePart = dateString.substring(0, 10); | |
60 | + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); | |
61 | + LocalDate date = LocalDate.parse(datePart, formatter); | |
62 | + LocalDateTime dateTime = LocalDateTime.of(date, LocalTime.MIDNIGHT); | |
63 | + System.out.println("LocalDateTime with default time: " + dateTime); | |
64 | + return dateTime; | |
21 | 65 | } |
22 | 66 | } | ... | ... |
backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WDailyFundsManagerImpl.java
0 → 100644
... | ... | @@ -0,0 +1,97 @@ |
1 | +package com.hotent.chkpower.manager.impl; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | +import com.hotent.chkpower.model.WCurrent; | |
6 | +import com.hotent.chkpower.model.WDailyFunds; | |
7 | +import com.hotent.chkpower.dao.WDailyFundsDao; | |
8 | +import com.hotent.chkpower.manager.WDailyFundsManager; | |
9 | +import com.hotent.base.manager.impl.BaseManagerImpl; | |
10 | +import com.hotent.runtime.script.ScriptImpl; | |
11 | +import org.springframework.stereotype.Service; | |
12 | +import org.springframework.transaction.annotation.Transactional; | |
13 | + | |
14 | +import javax.annotation.Resource; | |
15 | +import java.time.LocalDateTime; | |
16 | +import java.util.HashMap; | |
17 | +import java.util.List; | |
18 | + | |
19 | + | |
20 | +/** | |
21 | + * 每日资金 服务实现类 | |
22 | + * | |
23 | + * @author cw | |
24 | + * @company 广州宏天软件股份有限公司 | |
25 | + * @since 2024-07-08 | |
26 | + */ | |
27 | +@Service | |
28 | +public class WDailyFundsManagerImpl extends BaseManagerImpl<WDailyFundsDao, WDailyFunds> implements WDailyFundsManager { | |
29 | + @Resource | |
30 | + private ScriptImpl scriptImpl; | |
31 | + | |
32 | + @Override | |
33 | + public WDailyFunds getDetail(String id) { | |
34 | + WDailyFunds wDailyFunds = this.get(id); | |
35 | + | |
36 | + | |
37 | + return wDailyFunds; | |
38 | + } | |
39 | + | |
40 | + @Override | |
41 | + @Transactional | |
42 | + public void createOrUpdate(WDailyFunds wDailyFunds) { | |
43 | + //新建或更新 | |
44 | + this.saveOrUpdate(wDailyFunds); | |
45 | + } | |
46 | + | |
47 | + | |
48 | + @Override | |
49 | + public void editWDailyFunds(List<HashMap<String,String>> wCurrentList, LocalDateTime fDate) { | |
50 | + if (wCurrentList == null || wCurrentList.size() == 0) {return;} | |
51 | + //验证 | |
52 | + verifyInitWDailyFunds(fDate); | |
53 | + List<WDailyFunds> data = baseMapper.selectWDailyFundsNews(wCurrentList, fDate); | |
54 | + if (data != null && data.size() > 0){ | |
55 | + for (WDailyFunds wDailyFunds : data) { | |
56 | + LambdaUpdateWrapper<WDailyFunds> wrapper = Wrappers.lambdaUpdate(); | |
57 | + //昨日余额 | |
58 | + wrapper.set(WDailyFunds::getFYesterdayAccountBalance, wDailyFunds.getFYesterdayAccountBalance()); | |
59 | + //今日余额 | |
60 | + wrapper.set(WDailyFunds::getFTodayAccountBalance, wDailyFunds.getFTodayAccountBalance()); | |
61 | + //余额差额 | |
62 | + wrapper.set(WDailyFunds::getFAccountBalanceDifference, wDailyFunds.getFAccountBalanceDifference()); | |
63 | + //今日净现金流 | |
64 | + wrapper.set(WDailyFunds::getFTodayNetCashFlow, wDailyFunds.getFTodayNetCashFlow()); | |
65 | + //今日被冻结金额 | |
66 | + wrapper.set(WDailyFunds::getFTodayFreezeAmount, wDailyFunds.getFTodayFreezeAmount()); | |
67 | + //今日冻结上限 | |
68 | + wrapper.set(WDailyFunds::getFTodayFreezing, wDailyFunds.getFTodayFreezing()); | |
69 | + | |
70 | + //更新时间 | |
71 | + wrapper.set(WDailyFunds::getFUpdateTime, LocalDateTime.now()); | |
72 | + //更新人 | |
73 | + wrapper.set(WDailyFunds::getFUpdateBy, scriptImpl.getCurrentUserName()); | |
74 | + //更新人id | |
75 | + wrapper.set(WDailyFunds::getFUpdateId, scriptImpl.getCurrentUserId()); | |
76 | + | |
77 | + //复核状态 | |
78 | + wrapper.set(WDailyFunds::getFInspStatusName, "待复核"); | |
79 | + //复核时间 | |
80 | + wrapper.set(WDailyFunds::getFInspTime, null); | |
81 | + //复核备注 | |
82 | + wrapper.set(WDailyFunds::getFInspNotes, null); | |
83 | + //条件 | |
84 | + wrapper.eq(WDailyFunds::getId, wDailyFunds.getId()); | |
85 | + baseMapper.update(null,wrapper); | |
86 | + } | |
87 | + } | |
88 | + } | |
89 | + | |
90 | + private void verifyInitWDailyFunds(LocalDateTime fDate) { | |
91 | + Integer count = baseMapper.selectWDailyFundsCount(fDate); | |
92 | + if (count == null || count == 0) { | |
93 | + baseMapper.insertInitWDailyFunds(fDate); | |
94 | + } | |
95 | + } | |
96 | + | |
97 | +} | ... | ... |
backend/chkpower/src/main/java/com/hotent/chkpower/model/WDailyFunds.java
0 → 100644
... | ... | @@ -0,0 +1,363 @@ |
1 | +package com.hotent.chkpower.model; | |
2 | + | |
3 | +import java.math.BigDecimal; | |
4 | +import com.baomidou.mybatisplus.annotation.IdType; | |
5 | +import com.hotent.base.entity.BaseModel; | |
6 | +import com.baomidou.mybatisplus.extension.activerecord.Model; | |
7 | +import com.baomidou.mybatisplus.annotation.TableId; | |
8 | +import java.time.LocalDateTime; | |
9 | +import com.baomidou.mybatisplus.annotation.TableField; | |
10 | +import java.io.Serializable; | |
11 | +import io.swagger.annotations.ApiModel; | |
12 | +import io.swagger.annotations.ApiModelProperty; | |
13 | +import com.fasterxml.jackson.annotation.JsonProperty; | |
14 | +/** | |
15 | + * 每日资金 | |
16 | + * | |
17 | + * @company 广州宏天软件股份有限公司 | |
18 | + * @author cw | |
19 | + * @since 2024-07-08 | |
20 | + */ | |
21 | +@ApiModel(value="WDailyFunds对象", description="每日资金") | |
22 | +public class WDailyFunds extends BaseModel<WDailyFunds> { | |
23 | + | |
24 | + private static final long serialVersionUID = 1L; | |
25 | + @ApiModelProperty(value = "主键") | |
26 | + @TableId(value = "ID_", type = IdType.ASSIGN_ID) | |
27 | + @JsonProperty("id") | |
28 | + private String id; | |
29 | + | |
30 | + @ApiModelProperty(value = "外键") | |
31 | + @TableField("REF_ID_") | |
32 | + @JsonProperty("refId") | |
33 | + private String refId; | |
34 | + | |
35 | + @ApiModelProperty(value = "日期") | |
36 | + @TableField("F_date") | |
37 | + @JsonProperty("fDate") | |
38 | + private LocalDateTime fDate; | |
39 | + | |
40 | + @ApiModelProperty(value = "公司") | |
41 | + @TableField("F_org_name") | |
42 | + @JsonProperty("fOrgName") | |
43 | + private String fOrgName; | |
44 | + | |
45 | + @ApiModelProperty(value = "公司id") | |
46 | + @TableField("F_org_id") | |
47 | + @JsonProperty("fOrgId") | |
48 | + private String fOrgId; | |
49 | + | |
50 | + @ApiModelProperty(value = "公司类型") | |
51 | + @TableField("F_org_type") | |
52 | + @JsonProperty("fOrgType") | |
53 | + private String fOrgType; | |
54 | + | |
55 | + @ApiModelProperty(value = "昨日余额") | |
56 | + @TableField("F_yesterday_account_balance") | |
57 | + @JsonProperty("fYesterdayAccountBalance") | |
58 | + private BigDecimal fYesterdayAccountBalance; | |
59 | + | |
60 | + @ApiModelProperty(value = "今日余额") | |
61 | + @TableField("F_today_account_balance") | |
62 | + @JsonProperty("fTodayAccountBalance") | |
63 | + private BigDecimal fTodayAccountBalance; | |
64 | + | |
65 | + @ApiModelProperty(value = "余额差额") | |
66 | + @TableField("F_account_balance_difference") | |
67 | + @JsonProperty("fAccountBalanceDifference") | |
68 | + private BigDecimal fAccountBalanceDifference; | |
69 | + | |
70 | + @ApiModelProperty(value = "今日净现金流") | |
71 | + @TableField("F_today_net_cash_flow") | |
72 | + @JsonProperty("fTodayNetCashFlow") | |
73 | + private BigDecimal fTodayNetCashFlow; | |
74 | + | |
75 | + @ApiModelProperty(value = "今日被冻结金额") | |
76 | + @TableField("F_today_freeze_amount") | |
77 | + @JsonProperty("fTodayFreezeAmount") | |
78 | + private BigDecimal fTodayFreezeAmount; | |
79 | + | |
80 | + @ApiModelProperty(value = "今日冻结上限") | |
81 | + @TableField("F_today_freezing") | |
82 | + @JsonProperty("fTodayFreezing") | |
83 | + private BigDecimal fTodayFreezing; | |
84 | + | |
85 | + @ApiModelProperty(value = "复核状态") | |
86 | + @TableField("F_insp_status_name") | |
87 | + @JsonProperty("fInspStatusName") | |
88 | + private String fInspStatusName; | |
89 | + | |
90 | + @ApiModelProperty(value = "复核时间") | |
91 | + @TableField("F_insp_time") | |
92 | + @JsonProperty("fInspTime") | |
93 | + private LocalDateTime fInspTime; | |
94 | + | |
95 | + @ApiModelProperty(value = "复核备注") | |
96 | + @TableField("F_insp_notes") | |
97 | + @JsonProperty("fInspNotes") | |
98 | + private String fInspNotes; | |
99 | + | |
100 | + @ApiModelProperty(value = "复核人") | |
101 | + @TableField("F_insp_by") | |
102 | + @JsonProperty("fInspBy") | |
103 | + private String fInspBy; | |
104 | + | |
105 | + @ApiModelProperty(value = "复核人id") | |
106 | + @TableField("F_insp_id") | |
107 | + @JsonProperty("fInspId") | |
108 | + private String fInspId; | |
109 | + | |
110 | + @ApiModelProperty(value = "创建人") | |
111 | + @TableField("F_create_by") | |
112 | + @JsonProperty("fCreateBy") | |
113 | + private String fCreateBy; | |
114 | + | |
115 | + @ApiModelProperty(value = "创建人id") | |
116 | + @TableField("F_create_id") | |
117 | + @JsonProperty("fCreateId") | |
118 | + private String fCreateId; | |
119 | + | |
120 | + @ApiModelProperty(value = "创建时间") | |
121 | + @TableField("F_create_time") | |
122 | + @JsonProperty("fCreateTime") | |
123 | + private LocalDateTime fCreateTime; | |
124 | + | |
125 | + @ApiModelProperty(value = "修改人") | |
126 | + @TableField("F_update_by") | |
127 | + @JsonProperty("fUpdateBy") | |
128 | + private String fUpdateBy; | |
129 | + | |
130 | + @ApiModelProperty(value = "修改人id") | |
131 | + @TableField("F_update_id") | |
132 | + @JsonProperty("fUpdateId") | |
133 | + private String fUpdateId; | |
134 | + | |
135 | + @ApiModelProperty(value = "修改时间") | |
136 | + @TableField("F_update_time") | |
137 | + @JsonProperty("fUpdateTime") | |
138 | + private LocalDateTime fUpdateTime; | |
139 | + | |
140 | + @ApiModelProperty(value = "表单数据版本") | |
141 | + @TableField("F_form_data_rev_") | |
142 | + @JsonProperty("fFormDataRev") | |
143 | + private Long fFormDataRev; | |
144 | + | |
145 | + @ApiModelProperty(value = "排序") | |
146 | + @TableField("F_order_no") | |
147 | + @JsonProperty("fOrderNo") | |
148 | + private BigDecimal fOrderNo; | |
149 | + | |
150 | + | |
151 | + public String getId() { | |
152 | + return id; | |
153 | + } | |
154 | + | |
155 | + public void setId(String id) { | |
156 | + this.id = id; | |
157 | + } | |
158 | + public String getRefId() { | |
159 | + return refId; | |
160 | + } | |
161 | + | |
162 | + public void setRefId(String refId) { | |
163 | + this.refId = refId; | |
164 | + } | |
165 | + public LocalDateTime getFDate() { | |
166 | + return fDate; | |
167 | + } | |
168 | + | |
169 | + public void setFDate(LocalDateTime fDate) { | |
170 | + this.fDate = fDate; | |
171 | + } | |
172 | + public String getFOrgName() { | |
173 | + return fOrgName; | |
174 | + } | |
175 | + | |
176 | + public void setFOrgName(String fOrgName) { | |
177 | + this.fOrgName = fOrgName; | |
178 | + } | |
179 | + public String getFOrgId() { | |
180 | + return fOrgId; | |
181 | + } | |
182 | + | |
183 | + public void setFOrgId(String fOrgId) { | |
184 | + this.fOrgId = fOrgId; | |
185 | + } | |
186 | + public String getFOrgType() { | |
187 | + return fOrgType; | |
188 | + } | |
189 | + | |
190 | + public void setFOrgType(String fOrgType) { | |
191 | + this.fOrgType = fOrgType; | |
192 | + } | |
193 | + public BigDecimal getFYesterdayAccountBalance() { | |
194 | + return fYesterdayAccountBalance; | |
195 | + } | |
196 | + | |
197 | + public void setFYesterdayAccountBalance(BigDecimal fYesterdayAccountBalance) { | |
198 | + this.fYesterdayAccountBalance = fYesterdayAccountBalance; | |
199 | + } | |
200 | + public BigDecimal getFTodayAccountBalance() { | |
201 | + return fTodayAccountBalance; | |
202 | + } | |
203 | + | |
204 | + public void setFTodayAccountBalance(BigDecimal fTodayAccountBalance) { | |
205 | + this.fTodayAccountBalance = fTodayAccountBalance; | |
206 | + } | |
207 | + public BigDecimal getFAccountBalanceDifference() { | |
208 | + return fAccountBalanceDifference; | |
209 | + } | |
210 | + | |
211 | + public void setFAccountBalanceDifference(BigDecimal fAccountBalanceDifference) { | |
212 | + this.fAccountBalanceDifference = fAccountBalanceDifference; | |
213 | + } | |
214 | + public BigDecimal getFTodayNetCashFlow() { | |
215 | + return fTodayNetCashFlow; | |
216 | + } | |
217 | + | |
218 | + public void setFTodayNetCashFlow(BigDecimal fTodayNetCashFlow) { | |
219 | + this.fTodayNetCashFlow = fTodayNetCashFlow; | |
220 | + } | |
221 | + public BigDecimal getFTodayFreezeAmount() { | |
222 | + return fTodayFreezeAmount; | |
223 | + } | |
224 | + | |
225 | + public void setFTodayFreezeAmount(BigDecimal fTodayFreezeAmount) { | |
226 | + this.fTodayFreezeAmount = fTodayFreezeAmount; | |
227 | + } | |
228 | + public BigDecimal getFTodayFreezing() { | |
229 | + return fTodayFreezing; | |
230 | + } | |
231 | + | |
232 | + public void setFTodayFreezing(BigDecimal fTodayFreezing) { | |
233 | + this.fTodayFreezing = fTodayFreezing; | |
234 | + } | |
235 | + public String getFInspStatusName() { | |
236 | + return fInspStatusName; | |
237 | + } | |
238 | + | |
239 | + public void setFInspStatusName(String fInspStatusName) { | |
240 | + this.fInspStatusName = fInspStatusName; | |
241 | + } | |
242 | + public LocalDateTime getFInspTime() { | |
243 | + return fInspTime; | |
244 | + } | |
245 | + | |
246 | + public void setFInspTime(LocalDateTime fInspTime) { | |
247 | + this.fInspTime = fInspTime; | |
248 | + } | |
249 | + public String getFInspNotes() { | |
250 | + return fInspNotes; | |
251 | + } | |
252 | + | |
253 | + public void setFInspNotes(String fInspNotes) { | |
254 | + this.fInspNotes = fInspNotes; | |
255 | + } | |
256 | + public String getFInspBy() { | |
257 | + return fInspBy; | |
258 | + } | |
259 | + | |
260 | + public void setFInspBy(String fInspBy) { | |
261 | + this.fInspBy = fInspBy; | |
262 | + } | |
263 | + public String getFInspId() { | |
264 | + return fInspId; | |
265 | + } | |
266 | + | |
267 | + public void setFInspId(String fInspId) { | |
268 | + this.fInspId = fInspId; | |
269 | + } | |
270 | + public String getFCreateBy() { | |
271 | + return fCreateBy; | |
272 | + } | |
273 | + | |
274 | + public void setFCreateBy(String fCreateBy) { | |
275 | + this.fCreateBy = fCreateBy; | |
276 | + } | |
277 | + public String getFCreateId() { | |
278 | + return fCreateId; | |
279 | + } | |
280 | + | |
281 | + public void setFCreateId(String fCreateId) { | |
282 | + this.fCreateId = fCreateId; | |
283 | + } | |
284 | + public LocalDateTime getFCreateTime() { | |
285 | + return fCreateTime; | |
286 | + } | |
287 | + | |
288 | + public void setFCreateTime(LocalDateTime fCreateTime) { | |
289 | + this.fCreateTime = fCreateTime; | |
290 | + } | |
291 | + public String getFUpdateBy() { | |
292 | + return fUpdateBy; | |
293 | + } | |
294 | + | |
295 | + public void setFUpdateBy(String fUpdateBy) { | |
296 | + this.fUpdateBy = fUpdateBy; | |
297 | + } | |
298 | + public String getFUpdateId() { | |
299 | + return fUpdateId; | |
300 | + } | |
301 | + | |
302 | + public void setFUpdateId(String fUpdateId) { | |
303 | + this.fUpdateId = fUpdateId; | |
304 | + } | |
305 | + public LocalDateTime getFUpdateTime() { | |
306 | + return fUpdateTime; | |
307 | + } | |
308 | + | |
309 | + public void setFUpdateTime(LocalDateTime fUpdateTime) { | |
310 | + this.fUpdateTime = fUpdateTime; | |
311 | + } | |
312 | + public Long getFFormDataRev() { | |
313 | + return fFormDataRev; | |
314 | + } | |
315 | + | |
316 | + public void setFFormDataRev(Long fFormDataRev) { | |
317 | + this.fFormDataRev = fFormDataRev; | |
318 | + } | |
319 | + public BigDecimal getFOrderNo() { | |
320 | + return fOrderNo; | |
321 | + } | |
322 | + | |
323 | + public void setFOrderNo(BigDecimal fOrderNo) { | |
324 | + this.fOrderNo = fOrderNo; | |
325 | + } | |
326 | + | |
327 | + | |
328 | + @Override | |
329 | + protected Serializable pkVal() { | |
330 | + return this.id; | |
331 | + } | |
332 | + | |
333 | + @Override | |
334 | + public String toString() { | |
335 | + return "WDailyFunds{" + | |
336 | + "id=" + id + | |
337 | + ", refId=" + refId + | |
338 | + ", fDate=" + fDate + | |
339 | + ", fOrgName=" + fOrgName + | |
340 | + ", fOrgId=" + fOrgId + | |
341 | + ", fOrgType=" + fOrgType + | |
342 | + ", fYesterdayAccountBalance=" + fYesterdayAccountBalance + | |
343 | + ", fTodayAccountBalance=" + fTodayAccountBalance + | |
344 | + ", fAccountBalanceDifference=" + fAccountBalanceDifference + | |
345 | + ", fTodayNetCashFlow=" + fTodayNetCashFlow + | |
346 | + ", fTodayFreezeAmount=" + fTodayFreezeAmount + | |
347 | + ", fTodayFreezing=" + fTodayFreezing + | |
348 | + ", fInspStatusName=" + fInspStatusName + | |
349 | + ", fInspTime=" + fInspTime + | |
350 | + ", fInspNotes=" + fInspNotes + | |
351 | + ", fInspBy=" + fInspBy + | |
352 | + ", fInspId=" + fInspId + | |
353 | + ", fCreateBy=" + fCreateBy + | |
354 | + ", fCreateId=" + fCreateId + | |
355 | + ", fCreateTime=" + fCreateTime + | |
356 | + ", fUpdateBy=" + fUpdateBy + | |
357 | + ", fUpdateId=" + fUpdateId + | |
358 | + ", fUpdateTime=" + fUpdateTime + | |
359 | + ", fFormDataRev=" + fFormDataRev + | |
360 | + ", fOrderNo=" + fOrderNo + | |
361 | + "}"; | |
362 | + } | |
363 | +} | ... | ... |
backend/chkpower/src/main/resources/mapper/WCurrentMapper.xml
... | ... | @@ -107,7 +107,7 @@ |
107 | 107 | LEFT JOIN ( |
108 | 108 | SELECT F_org_id, F_org_name,SUM(F_account_balance) AS F_account_balance |
109 | 109 | FROM w_current |
110 | - WHERE F_date =#{fDate} | |
110 | + WHERE DATE(F_date) =DATE(#{fDate}) | |
111 | 111 | GROUP BY F_org_id, F_org_name |
112 | 112 | ) YE ON YE.F_org_id = acc.F_org_id |
113 | 113 | WHERE 1=1 | ... | ... |
backend/chkpower/src/main/resources/mapper/WDailyFundsMapper.xml
0 → 100644
... | ... | @@ -0,0 +1,105 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.hotent.chkpower.dao.WDailyFundsDao"> | |
4 | + | |
5 | + <!-- 通用查询映射结果 --> | |
6 | + <resultMap id="BaseResultMap" type="com.hotent.chkpower.model.WDailyFunds"> | |
7 | + <id column="ID_" property="id" /> | |
8 | + <result column="REF_ID_" property="refId" /> | |
9 | + <result column="F_date" property="fDate" /> | |
10 | + <result column="F_org_name" property="fOrgName" /> | |
11 | + <result column="F_org_id" property="fOrgId" /> | |
12 | + <result column="F_org_type" property="fOrgType" /> | |
13 | + <result column="F_yesterday_account_balance" property="fYesterdayAccountBalance" /> | |
14 | + <result column="F_today_account_balance" property="fTodayAccountBalance" /> | |
15 | + <result column="F_account_balance_difference" property="fAccountBalanceDifference" /> | |
16 | + <result column="F_today_net_cash_flow" property="fTodayNetCashFlow" /> | |
17 | + <result column="F_today_freeze_amount" property="fTodayFreezeAmount" /> | |
18 | + <result column="F_today_freezing" property="fTodayFreezing" /> | |
19 | + <result column="F_insp_status_name" property="fInspStatusName" /> | |
20 | + <result column="F_insp_time" property="fInspTime" /> | |
21 | + <result column="F_insp_notes" property="fInspNotes" /> | |
22 | + <result column="F_insp_by" property="fInspBy" /> | |
23 | + <result column="F_insp_id" property="fInspId" /> | |
24 | + <result column="F_create_by" property="fCreateBy" /> | |
25 | + <result column="F_create_id" property="fCreateId" /> | |
26 | + <result column="F_create_time" property="fCreateTime" /> | |
27 | + <result column="F_update_by" property="fUpdateBy" /> | |
28 | + <result column="F_update_id" property="fUpdateId" /> | |
29 | + <result column="F_update_time" property="fUpdateTime" /> | |
30 | + <result column="F_form_data_rev_" property="fFormDataRev" /> | |
31 | + <result column="F_order_no" property="fOrderNo" /> | |
32 | + </resultMap> | |
33 | + | |
34 | + <!-- 通用查询结果列 --> | |
35 | + <sql id="Base_Column_List"> | |
36 | + ID_, REF_ID_, F_date, F_org_name, F_org_id, F_org_type, F_yesterday_account_balance, F_today_account_balance, F_account_balance_difference, F_today_net_cash_flow, F_today_freeze_amount, F_today_freezing, F_insp_status_name, F_insp_time, F_insp_notes, F_insp_by, F_insp_id, F_create_by, F_create_id, F_create_time, F_update_by, F_update_id, F_update_time, F_form_data_rev_, F_order_no | |
37 | + </sql> | |
38 | + | |
39 | + <select id="selectPage" resultMap="BaseResultMap"> | |
40 | + select | |
41 | + <include refid="Base_Column_List"/> | |
42 | + from | |
43 | + w_daily_funds | |
44 | + ${ew.customSqlSegment} | |
45 | + </select> | |
46 | + | |
47 | + <select id="selectList" resultMap="BaseResultMap"> | |
48 | + select | |
49 | + <include refid="Base_Column_List"/> | |
50 | + from | |
51 | + w_daily_funds | |
52 | + ${ew.customSqlSegment} | |
53 | + </select> | |
54 | + | |
55 | + <select id="selectById" resultMap="BaseResultMap"> | |
56 | + select | |
57 | + <include refid="Base_Column_List"/> | |
58 | + from | |
59 | + w_daily_funds | |
60 | + where | |
61 | + ID_ = #{id} | |
62 | + </select> | |
63 | + | |
64 | + <insert id="insertInitWDailyFunds"> | |
65 | + INSERT into w_daily_funds(ID_,F_date,F_org_id,F_org_name,F_org_type,F_order_no,F_insp_status_name) | |
66 | + SELECT REPLACE(UUID(), '-', '') as ID_,DATE_FORMAT(#{fDate,jdbcType=TIMESTAMP}, '%Y-%m-%d 00:00:00') as F_date,org.ID_ as F_org_id,org.NAME_ as F_org_name,orgParams.VALUE_ as F_org_type,org.ORDER_NO_ as F_order_no,'待复核' as F_insp_status_name | |
67 | + FROM uc_org org | |
68 | + JOIN uc_org_params orgParams on orgParams.ORG_ID_= org.ID_ | |
69 | + </insert> | |
70 | + | |
71 | + <select id="selectWDailyFundsCount" resultType="java.lang.Integer"> | |
72 | + SELECT COUNT(ID_) FROM w_daily_funds WHERE DATE(F_date) = DATE(#{fDate,jdbcType=TIMESTAMP}) | |
73 | + </select> | |
74 | + | |
75 | + <select id="selectWDailyFundsNews" resultType="com.hotent.chkpower.model.WDailyFunds"> | |
76 | + SELECT funds.F_date,funds.id_,funds.F_org_id,funds.F_org_name , | |
77 | + jrye.F_today_account_balance,zrye.F_yesterday_account_balance,(IFNULL(zrye.F_yesterday_account_balance,0) - IFNULL(jrye.F_today_account_balance,0)) as F_account_balance_difference | |
78 | + ,jxjl.F_today_net_cash_flow,jrye.F_today_freeze_amount,jrye.F_today_freezing | |
79 | + FROM w_daily_funds funds | |
80 | + LEFT JOIN ( | |
81 | + SELECT F_org_id,SUM(F_account_balance) AS F_today_account_balance,SUM(F_freeze_amount) as F_today_freeze_amount,SUM(F_freezing) AS F_today_freezing | |
82 | + FROM w_current | |
83 | + WHERE DATE(F_date) =DATE(#{fDate,jdbcType=TIMESTAMP}) | |
84 | + GROUP BY F_org_id | |
85 | + ) jrye on jrye.F_org_id = funds.F_org_id | |
86 | + LEFT JOIN ( | |
87 | + SELECT F_org_id,SUM(F_account_balance) AS F_yesterday_account_balance | |
88 | + FROM w_current | |
89 | + WHERE DATE(F_date) =(SELECT DATE_SUB(DATE(#{fDate,jdbcType=TIMESTAMP}), INTERVAL 1 DAY)) | |
90 | + GROUP BY F_org_id | |
91 | + ) zrye on zrye.F_org_id = funds.F_org_id | |
92 | + LEFT JOIN ( | |
93 | + SELECT F_org_id, SUM(F_total_net_cash_flow) as F_today_net_cash_flow | |
94 | + FROM w_finance WHERE DATE(F_date) =DATE(#{fDate,jdbcType=TIMESTAMP}) | |
95 | + GROUP BY F_org_id | |
96 | + ) jxjl on jxjl.F_org_id = funds.F_org_id | |
97 | + WHERE DATE(funds.F_date) =DATE(#{fDate,jdbcType=TIMESTAMP}) | |
98 | + <if test="wCurrentList != null and wCurrentList.size() > 0"> | |
99 | + and funds.F_org_id in | |
100 | + <foreach collection="wCurrentList" separator="," item="item" open="(" close=")"> | |
101 | + #{item.F_org_id} | |
102 | + </foreach> | |
103 | + </if> | |
104 | + </select> | |
105 | +</mapper> | ... | ... |
backend/chkpower/src/main/resources/mapper/WFinanceMapper.xml
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | LEFT JOIN ( |
66 | 66 | SELECT F_org_id,SUM(F_total_income) AS F_total_income,SUM(F_total_disbursement) AS F_total_disbursement,SUM(F_total_net_cash_flow) AS F_total_net_cash_flow |
67 | 67 | FROM w_finance |
68 | - WHERE F_date = #{fDate} | |
68 | + WHERE DATE(F_date) = DATE(#{fDate}) | |
69 | 69 | GROUP BY F_org_id |
70 | 70 | ) JE ON JE.F_org_id = org.ID_ |
71 | 71 | WHERE 1=1 | ... | ... |