Commit 10e976f52c2d3920ff99ffff0e0c28fc19353885

Authored by 陈威
1 parent de7d4bd9
Exists in master

批量修改

backend/chkpower/src/main/java/com/hotent/chkpower/controller/WDailyFundsController.java
1 1 package com.hotent.chkpower.controller;
2 2  
3 3  
  4 +import com.hotent.chkpower.vo.WDailyFundsVo;
  5 +import com.hotent.uc.model.ShiftUser;
4 6 import org.springframework.web.bind.annotation.GetMapping;
5 7 import org.springframework.web.bind.annotation.PostMapping;
6 8 import org.springframework.web.bind.annotation.RequestBody;
... ... @@ -15,6 +17,8 @@ import com.hotent.base.controller.BaseController;
15 17 import com.hotent.chkpower.model.WDailyFunds;
16 18 import com.hotent.chkpower.manager.WDailyFundsManager;
17 19  
  20 +import java.util.List;
  21 +
18 22 /**
19 23 * 每日资金 前端控制器
20 24 *
... ... @@ -45,6 +49,11 @@ public class WDailyFundsController extends BaseController<WDailyFundsManager, WD
45 49 * @return
46 50 * @exception
47 51 */
  52 +
  53 +
  54 +
  55 +
  56 +
48 57 @PostMapping(value="/save")
49 58 @ApiOperation(value = "新增,更新每日资金数据", httpMethod = "POST", notes = "新增,更新每日资金数据")
50 59 public CommonResult<String> save(@ApiParam(name="WDailyFunds",value="每日资金对象", required = true)@RequestBody WDailyFunds wDailyFunds) throws Exception{
... ... @@ -53,4 +62,12 @@ public class WDailyFundsController extends BaseController&lt;WDailyFundsManager, WD
53 62 return CommonResult.<String>ok().message(msg);
54 63 }
55 64  
  65 + @PostMapping(value="/updateInsp")
  66 + public CommonResult<String> updateInsp(@RequestBody WDailyFundsVo wDailyFundsList) throws Exception{
  67 + baseService.updateInsp(wDailyFundsList);
  68 +
  69 + return CommonResult.<String>ok().message("成功");
  70 + }
  71 +
  72 +
56 73 }
... ...
backend/chkpower/src/main/java/com/hotent/chkpower/manager/WDailyFundsManager.java
... ... @@ -3,6 +3,7 @@ package com.hotent.chkpower.manager;
3 3 import com.hotent.chkpower.model.WCurrent;
4 4 import com.hotent.chkpower.model.WDailyFunds;
5 5 import com.hotent.base.manager.BaseManager;
  6 +import com.hotent.chkpower.vo.WDailyFundsVo;
6 7  
7 8 import java.time.LocalDateTime;
8 9 import java.util.HashMap;
... ... @@ -36,4 +37,6 @@ public interface WDailyFundsManager extends BaseManager&lt;WDailyFunds&gt; {
36 37 void editWDailyFunds(List<HashMap<String,String>> wCurrentList, LocalDateTime date);
37 38  
38 39  
  40 + void updateInsp( WDailyFundsVo wDailyFundsList);
  41 +
39 42 }
... ...
backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WDailyFundsManagerImpl.java
... ... @@ -7,6 +7,7 @@ import com.hotent.chkpower.model.WDailyFunds;
7 7 import com.hotent.chkpower.dao.WDailyFundsDao;
8 8 import com.hotent.chkpower.manager.WDailyFundsManager;
9 9 import com.hotent.base.manager.impl.BaseManagerImpl;
  10 +import com.hotent.chkpower.vo.WDailyFundsVo;
10 11 import com.hotent.runtime.script.ScriptImpl;
11 12 import org.springframework.stereotype.Service;
12 13 import org.springframework.transaction.annotation.Transactional;
... ... @@ -45,6 +46,7 @@ public class WDailyFundsManagerImpl extends BaseManagerImpl&lt;WDailyFundsDao, WDai
45 46 }
46 47  
47 48  
  49 + @Transactional
48 50 @Override
49 51 public void editWDailyFunds(List<HashMap<String,String>> wCurrentList, LocalDateTime fDate) {
50 52 if (wCurrentList == null || wCurrentList.size() == 0) {return;}
... ... @@ -87,6 +89,22 @@ public class WDailyFundsManagerImpl extends BaseManagerImpl&lt;WDailyFundsDao, WDai
87 89 }
88 90 }
89 91  
  92 + @Override
  93 + public void updateInsp( WDailyFundsVo wDailyFundsList) {
  94 + List<WDailyFunds> wDailyFunds = wDailyFundsList.getwDailyFundsList();
  95 + if (wDailyFunds == null || wDailyFunds.size() == 0) {return;}
  96 + for (WDailyFunds wDailyFund : wDailyFunds) {
  97 + baseMapper.update(null,Wrappers.<WDailyFunds>lambdaUpdate()
  98 + .set(WDailyFunds::getFUpdateBy, scriptImpl.getCurrentUserName())
  99 + .set(WDailyFunds::getFUpdateId, scriptImpl.getCurrentUserId())
  100 + .set(WDailyFunds::getFInspStatusName, wDailyFundsList.getfInspStatusName())
  101 + .set(WDailyFunds::getFInspTime, LocalDateTime.now())
  102 + .set(WDailyFunds::getFInspNotes, wDailyFundsList.getfInspNotes())
  103 + .eq(WDailyFunds::getId, wDailyFund.getId())
  104 + );
  105 + }
  106 + }
  107 +
90 108 private void verifyInitWDailyFunds(LocalDateTime fDate) {
91 109 Integer count = baseMapper.selectWDailyFundsCount(fDate);
92 110 if (count == null || count == 0) {
... ...
backend/chkpower/src/main/java/com/hotent/chkpower/vo/WDailyFundsVo.java 0 → 100644
... ... @@ -0,0 +1,38 @@
  1 +package com.hotent.chkpower.vo;
  2 +
  3 +import com.hotent.chkpower.model.WDailyFunds;
  4 +import lombok.Data;
  5 +
  6 +import java.util.ArrayList;
  7 +import java.util.List;
  8 +
  9 +public class WDailyFundsVo {
  10 + private List<WDailyFunds> wDailyFundsList =new ArrayList<WDailyFunds>();
  11 + private String fInspStatusName;
  12 + private String fInspNotes;
  13 +
  14 +
  15 + public List<WDailyFunds> getwDailyFundsList() {
  16 + return wDailyFundsList;
  17 + }
  18 +
  19 + public void setwDailyFundsList(List<WDailyFunds> wDailyFundsList) {
  20 + this.wDailyFundsList = wDailyFundsList;
  21 + }
  22 +
  23 + public String getfInspStatusName() {
  24 + return fInspStatusName;
  25 + }
  26 +
  27 + public void setfInspStatusName(String fInspStatusName) {
  28 + this.fInspStatusName = fInspStatusName;
  29 + }
  30 +
  31 + public String getfInspNotes() {
  32 + return fInspNotes;
  33 + }
  34 +
  35 + public void setfInspNotes(String fInspNotes) {
  36 + this.fInspNotes = fInspNotes;
  37 + }
  38 +}
... ...