From 4c2fd0af7438c2b15fb4bda2a095da2b6d3c1646 Mon Sep 17 00:00:00 2001 From: chenwei Date: Tue, 9 Jul 2024 01:48:36 +0800 Subject: [PATCH] 导出功能 --- backend/chkpower/src/main/java/com/hotent/chkpower/controller/WCurrentReportController.java | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ backend/chkpower/src/main/java/com/hotent/chkpower/controller/WDailyFundsController.java | 1 - backend/chkpower/src/main/java/com/hotent/chkpower/dao/WCurrentReportDao.java | 20 ++++++++++++++++++++ backend/chkpower/src/main/java/com/hotent/chkpower/dao/WFinanceDao.java | 3 +++ backend/chkpower/src/main/java/com/hotent/chkpower/manager/WCurrentReportManager.java | 30 ++++++++++++++++++++++++++++++ backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WCurrentReportManagerImpl.java | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WDailyFundsManagerImpl.java | 34 ++++++++++++++++++++++++++++++++++ backend/chkpower/src/main/java/com/hotent/chkpower/model/WCurrentReport.java | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ backend/chkpower/src/main/resources/mapper/WCurrentReportMapper.xml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ backend/chkpower/src/main/resources/mapper/WFinanceMapper.xml | 14 ++++++++++++++ frontend/front/src/api/service/dailyFunds.js | 11 +++++++++++ frontend/front/src/components/tableSlot/dailyFunds/updateInspBtn.vue | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 12 files changed, 671 insertions(+), 1 deletion(-) create mode 100644 backend/chkpower/src/main/java/com/hotent/chkpower/controller/WCurrentReportController.java create mode 100644 backend/chkpower/src/main/java/com/hotent/chkpower/dao/WCurrentReportDao.java create mode 100644 backend/chkpower/src/main/java/com/hotent/chkpower/manager/WCurrentReportManager.java create mode 100644 backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WCurrentReportManagerImpl.java create mode 100644 backend/chkpower/src/main/java/com/hotent/chkpower/model/WCurrentReport.java create mode 100644 backend/chkpower/src/main/resources/mapper/WCurrentReportMapper.xml create mode 100644 frontend/front/src/api/service/dailyFunds.js create mode 100644 frontend/front/src/components/tableSlot/dailyFunds/updateInspBtn.vue diff --git a/backend/chkpower/src/main/java/com/hotent/chkpower/controller/WCurrentReportController.java b/backend/chkpower/src/main/java/com/hotent/chkpower/controller/WCurrentReportController.java new file mode 100644 index 0000000..1972747 --- /dev/null +++ b/backend/chkpower/src/main/java/com/hotent/chkpower/controller/WCurrentReportController.java @@ -0,0 +1,55 @@ +package com.hotent.chkpower.controller; + + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import com.hotent.base.model.CommonResult; +import com.hotent.base.util.StringUtil; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.RestController; +import com.hotent.base.controller.BaseController; +import com.hotent.chkpower.model.WCurrentReport; +import com.hotent.chkpower.manager.WCurrentReportManager; + +/** + * 活期账户汇报 前端控制器 + * + * @company 广州宏天软件股份有限公司 + * @author cw + * @since 2024-07-09 + */ +@RestController +@RequestMapping("/wCurrentReport/v1/") +public class WCurrentReportController extends BaseController { + + /** + * 根据id获取活期账户汇报数据详情 + * @param id + * @return + * @throws Exception + * ModelAndView + */ + @GetMapping(value="/getDetail") + @ApiOperation(value="根据id获取活期账户汇报数据详情",httpMethod = "GET",notes = "根据id获取活期账户汇报数据详情") + public CommonResult getDetail(@ApiParam(name="id",value="业务对象主键", required = true)@RequestParam(required=true) String id) throws Exception{ + return CommonResult.ok().value(baseService.getDetail(id)); + } + /** + * 新增,更新活期账户汇报 + * @param wCurrentReport + * @throws Exception + * @return + * @exception + */ + @PostMapping(value="/save") + @ApiOperation(value = "新增,更新活期账户汇报数据", httpMethod = "POST", notes = "新增,更新活期账户汇报数据") + public CommonResult save(@ApiParam(name="WCurrentReport",value="活期账户汇报对象", required = true)@RequestBody WCurrentReport wCurrentReport) throws Exception{ + String msg = StringUtil.isEmpty(wCurrentReport.getId()) ? "添加活期账户汇报成功" : "更新活期账户汇报成功"; + baseService.createOrUpdate(wCurrentReport); + return CommonResult.ok().message(msg); + } +} diff --git a/backend/chkpower/src/main/java/com/hotent/chkpower/controller/WDailyFundsController.java b/backend/chkpower/src/main/java/com/hotent/chkpower/controller/WDailyFundsController.java index 53a9cab..c947035 100644 --- a/backend/chkpower/src/main/java/com/hotent/chkpower/controller/WDailyFundsController.java +++ b/backend/chkpower/src/main/java/com/hotent/chkpower/controller/WDailyFundsController.java @@ -65,7 +65,6 @@ public class WDailyFundsController extends BaseController updateInsp(@RequestBody WDailyFundsVo wDailyFundsList) throws Exception{ baseService.updateInsp(wDailyFundsList); - return CommonResult.ok().message("成功"); } diff --git a/backend/chkpower/src/main/java/com/hotent/chkpower/dao/WCurrentReportDao.java b/backend/chkpower/src/main/java/com/hotent/chkpower/dao/WCurrentReportDao.java new file mode 100644 index 0000000..f01b1a8 --- /dev/null +++ b/backend/chkpower/src/main/java/com/hotent/chkpower/dao/WCurrentReportDao.java @@ -0,0 +1,20 @@ +package com.hotent.chkpower.dao; + +import com.hotent.chkpower.model.WCurrentReport; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 活期账户汇报 Mapper 接口 + * + * @company 广州宏天软件股份有限公司 + * @author cw + * @since 2024-07-09 + */ +public interface WCurrentReportDao extends BaseMapper { + + List selectInspList(@Param("fDate") LocalDateTime fDate,@Param("fOrgId") String fOrgId); +} diff --git a/backend/chkpower/src/main/java/com/hotent/chkpower/dao/WFinanceDao.java b/backend/chkpower/src/main/java/com/hotent/chkpower/dao/WFinanceDao.java index 0fdf198..8ee42dc 100644 --- a/backend/chkpower/src/main/java/com/hotent/chkpower/dao/WFinanceDao.java +++ b/backend/chkpower/src/main/java/com/hotent/chkpower/dao/WFinanceDao.java @@ -18,4 +18,7 @@ public interface WFinanceDao extends BaseMapper { List> getTransactionDetailsList(@Param("fOrgType") String fOrgType, @Param("fDate") String fDate); + void updateInsp(WFinance wFinance); + + } diff --git a/backend/chkpower/src/main/java/com/hotent/chkpower/manager/WCurrentReportManager.java b/backend/chkpower/src/main/java/com/hotent/chkpower/manager/WCurrentReportManager.java new file mode 100644 index 0000000..925f1a5 --- /dev/null +++ b/backend/chkpower/src/main/java/com/hotent/chkpower/manager/WCurrentReportManager.java @@ -0,0 +1,30 @@ +package com.hotent.chkpower.manager; + +import com.hotent.chkpower.model.WCurrentReport; +import com.hotent.base.manager.BaseManager; + +import java.time.LocalDateTime; + +/** + * 活期账户汇报 服务类 + * + * @company 广州宏天软件股份有限公司 + * @author cw + * @since 2024-07-09 + */ +public interface WCurrentReportManager extends BaseManager { + /** + * 根据主键获取详情 + * @param id + * @return + */ + WCurrentReport getDetail(String id); + /** + * 新建、更新活期账户汇报 + * @param wCurrentReport + * @return + */ + void createOrUpdate(WCurrentReport wCurrentReport); + + void updateInsp(LocalDateTime fDate, String fOrgId, String fInspStatusName, String fInspNotes); +} diff --git a/backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WCurrentReportManagerImpl.java b/backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WCurrentReportManagerImpl.java new file mode 100644 index 0000000..8f10bf6 --- /dev/null +++ b/backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WCurrentReportManagerImpl.java @@ -0,0 +1,63 @@ +package com.hotent.chkpower.manager.impl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hotent.chkpower.model.WCurrentReport; +import com.hotent.chkpower.dao.WCurrentReportDao; +import com.hotent.chkpower.manager.WCurrentReportManager; +import com.hotent.base.manager.impl.BaseManagerImpl; +import com.hotent.chkpower.model.WDailyFunds; +import com.hotent.runtime.script.ScriptImpl; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import java.time.LocalDateTime; +import java.util.List; +import javax.annotation.Resource; +import com.hotent.base.util.BeanUtils; + + +/** + * 活期账户汇报 服务实现类 + * + * @company 广州宏天软件股份有限公司 + * @author cw + * @since 2024-07-09 + */ +@Service +public class WCurrentReportManagerImpl extends BaseManagerImpl implements WCurrentReportManager { + @Resource + private ScriptImpl scriptImpl; + @Override + public WCurrentReport getDetail(String id) { + WCurrentReport wCurrentReport = this.get(id); + + + return wCurrentReport; + } + @Override + @Transactional + public void createOrUpdate(WCurrentReport wCurrentReport) { + //新建或更新 + this.saveOrUpdate(wCurrentReport); + } + + @Override + public void updateInsp(LocalDateTime fDate, String fOrgId, String fInspStatusName, String fInspNotes) { +// List wCurrentReports = baseMapper.selectInspList(Wrappers.lambdaQuery() +// .apply("DATE(F_date) = DATE('{0}') and id_ in (SELECT a.ref_id_ FROM w_current a WHERE DATE(a.F_date) = DATE('{1}') and a.F_org_id ='{2}')", fDate, fDate, fOrgId)); + + List wCurrentReports = baseMapper.selectInspList(fDate,fOrgId); + + for (WCurrentReport wCurrentReport : wCurrentReports) { + baseMapper.update(null,Wrappers.lambdaUpdate() + .set(WCurrentReport::getFUpdateBy, scriptImpl.getCurrentUserName()) + .set(WCurrentReport::getFUpdateId, scriptImpl.getCurrentUserId()) + .set(WCurrentReport::getFInspStatusName, fInspStatusName) + .set(WCurrentReport::getFInspTime, LocalDateTime.now()) + .set(WCurrentReport::getFInspNotes,fInspNotes) + .eq(WCurrentReport::getId, wCurrentReport.getId()) + ); + } + } +} diff --git a/backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WDailyFundsManagerImpl.java b/backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WDailyFundsManagerImpl.java index 7c62016..97c048c 100644 --- a/backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WDailyFundsManagerImpl.java +++ b/backend/chkpower/src/main/java/com/hotent/chkpower/manager/impl/WDailyFundsManagerImpl.java @@ -2,11 +2,17 @@ package com.hotent.chkpower.manager.impl; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hotent.chkpower.dao.WCurrentReportDao; +import com.hotent.chkpower.dao.WFinanceDao; +import com.hotent.chkpower.manager.WCurrentReportManager; +import com.hotent.chkpower.manager.WFinanceManager; import com.hotent.chkpower.model.WCurrent; +import com.hotent.chkpower.model.WCurrentReport; import com.hotent.chkpower.model.WDailyFunds; import com.hotent.chkpower.dao.WDailyFundsDao; import com.hotent.chkpower.manager.WDailyFundsManager; import com.hotent.base.manager.impl.BaseManagerImpl; +import com.hotent.chkpower.model.WFinance; import com.hotent.chkpower.vo.WDailyFundsVo; import com.hotent.runtime.script.ScriptImpl; import org.springframework.stereotype.Service; @@ -29,6 +35,12 @@ import java.util.List; public class WDailyFundsManagerImpl extends BaseManagerImpl implements WDailyFundsManager { @Resource private ScriptImpl scriptImpl; + @Resource + private WCurrentReportManager wCurrentReportManager; + @Resource + private WFinanceManager wFinanceManager; + @Resource + private WFinanceDao wFinanceDao; @Override public WDailyFunds getDetail(String id) { @@ -102,6 +114,28 @@ public class WDailyFundsManagerImpl extends BaseManagerImpllambdaUpdate() +// .set(WFinance::getFUpdateBy, scriptImpl.getCurrentUserName()) +// .set(WFinance::getFUpdateId, scriptImpl.getCurrentUserId()) +// .set(WFinance::getFInspStatusName, wDailyFundsList.getfInspStatusName()) +// .set(WFinance::getFInspTime, LocalDateTime.now()) +// .set(WFinance::getFInspNotes, wDailyFundsList.getfInspNotes()) +// .apply("DATE(F_date) = DATE(?)", wDailyFund.getFDate().toLocalDate()) +// .eq(WFinance::getFOrgId, wDailyFund.getFOrgId())); + + wCurrentReportManager.updateInsp(wDailyFund.getFDate(),wDailyFund.getFOrgId(),wDailyFundsList.getfInspStatusName(),wDailyFundsList.getfInspNotes()); } } diff --git a/backend/chkpower/src/main/java/com/hotent/chkpower/model/WCurrentReport.java b/backend/chkpower/src/main/java/com/hotent/chkpower/model/WCurrentReport.java new file mode 100644 index 0000000..97fca20 --- /dev/null +++ b/backend/chkpower/src/main/java/com/hotent/chkpower/model/WCurrentReport.java @@ -0,0 +1,258 @@ +package com.hotent.chkpower.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.hotent.base.entity.BaseModel; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * 活期账户汇报 + * + * @company 广州宏天软件股份有限公司 + * @author cw + * @since 2024-07-09 + */ +@ApiModel(value="WCurrentReport对象", description="活期账户汇报") +public class WCurrentReport extends BaseModel { + + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "主键") + @TableId(value = "ID_", type = IdType.ASSIGN_ID) + @JsonProperty("id") + private String id; + + @ApiModelProperty(value = "外键") + @TableField("REF_ID_") + @JsonProperty("refId") + private String refId; + + @ApiModelProperty(value = "备注") + @TableField("F_notes") + @JsonProperty("fNotes") + private String fNotes; + + @ApiModelProperty(value = "创建时间") + @TableField("F_create_time") + @JsonProperty("fCreateTime") + private LocalDateTime fCreateTime; + + @ApiModelProperty(value = "创建人") + @TableField("F_create_by") + @JsonProperty("fCreateBy") + private String fCreateBy; + + @ApiModelProperty(value = "创建人id") + @TableField("F_create_id") + @JsonProperty("fCreateId") + private String fCreateId; + + @ApiModelProperty(value = "核对时间") + @TableField("F_insp_time") + @JsonProperty("fInspTime") + private LocalDateTime fInspTime; + + @ApiModelProperty(value = "核对说明备注") + @TableField("F_insp_notes") + @JsonProperty("fInspNotes") + private String fInspNotes; + + @ApiModelProperty(value = "核对人") + @TableField("F_insp_by") + @JsonProperty("fInspBy") + private String fInspBy; + + @ApiModelProperty(value = "核对人ID") + @TableField("F_insp_by_id") + @JsonProperty("fInspById") + private String fInspById; + + @ApiModelProperty(value = "修改人") + @TableField("F_update_by") + @JsonProperty("fUpdateBy") + private String fUpdateBy; + + @ApiModelProperty(value = "修改人id") + @TableField("F_update_id") + @JsonProperty("fUpdateId") + private String fUpdateId; + + @ApiModelProperty(value = "修改时间") + @TableField("F_update_time") + @JsonProperty("fUpdateTime") + private LocalDateTime fUpdateTime; + + @ApiModelProperty(value = "核对状态") + @TableField("F_insp_status_name") + @JsonProperty("fInspStatusName") + private String fInspStatusName; + + @ApiModelProperty(value = "核对人ID") + @TableField("F_insp_id") + @JsonProperty("fInspId") + private String fInspId; + + @ApiModelProperty(value = "日期") + @TableField("F_date") + @JsonProperty("fDate") + private LocalDateTime fDate; + + @ApiModelProperty(value = "表单数据版本") + @TableField("F_form_data_rev_") + @JsonProperty("fFormDataRev") + private Long fFormDataRev; + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + public String getRefId() { + return refId; + } + + public void setRefId(String refId) { + this.refId = refId; + } + public String getFNotes() { + return fNotes; + } + + public void setFNotes(String fNotes) { + this.fNotes = fNotes; + } + public LocalDateTime getFCreateTime() { + return fCreateTime; + } + + public void setFCreateTime(LocalDateTime fCreateTime) { + this.fCreateTime = fCreateTime; + } + public String getFCreateBy() { + return fCreateBy; + } + + public void setFCreateBy(String fCreateBy) { + this.fCreateBy = fCreateBy; + } + public String getFCreateId() { + return fCreateId; + } + + public void setFCreateId(String fCreateId) { + this.fCreateId = fCreateId; + } + public LocalDateTime getFInspTime() { + return fInspTime; + } + + public void setFInspTime(LocalDateTime fInspTime) { + this.fInspTime = fInspTime; + } + public String getFInspNotes() { + return fInspNotes; + } + + public void setFInspNotes(String fInspNotes) { + this.fInspNotes = fInspNotes; + } + public String getFInspBy() { + return fInspBy; + } + + public void setFInspBy(String fInspBy) { + this.fInspBy = fInspBy; + } + public String getFInspById() { + return fInspById; + } + + public void setFInspById(String fInspById) { + this.fInspById = fInspById; + } + public String getFUpdateBy() { + return fUpdateBy; + } + + public void setFUpdateBy(String fUpdateBy) { + this.fUpdateBy = fUpdateBy; + } + public String getFUpdateId() { + return fUpdateId; + } + + public void setFUpdateId(String fUpdateId) { + this.fUpdateId = fUpdateId; + } + public LocalDateTime getFUpdateTime() { + return fUpdateTime; + } + + public void setFUpdateTime(LocalDateTime fUpdateTime) { + this.fUpdateTime = fUpdateTime; + } + public String getFInspStatusName() { + return fInspStatusName; + } + + public void setFInspStatusName(String fInspStatusName) { + this.fInspStatusName = fInspStatusName; + } + public String getFInspId() { + return fInspId; + } + + public void setFInspId(String fInspId) { + this.fInspId = fInspId; + } + public LocalDateTime getFDate() { + return fDate; + } + + public void setFDate(LocalDateTime fDate) { + this.fDate = fDate; + } + public Long getFFormDataRev() { + return fFormDataRev; + } + + public void setFFormDataRev(Long fFormDataRev) { + this.fFormDataRev = fFormDataRev; + } + + + @Override + protected Serializable pkVal() { + return this.id; + } + + @Override + public String toString() { + return "WCurrentReport{" + + "id=" + id + + ", refId=" + refId + + ", fNotes=" + fNotes + + ", fCreateTime=" + fCreateTime + + ", fCreateBy=" + fCreateBy + + ", fCreateId=" + fCreateId + + ", fInspTime=" + fInspTime + + ", fInspNotes=" + fInspNotes + + ", fInspBy=" + fInspBy + + ", fInspById=" + fInspById + + ", fUpdateBy=" + fUpdateBy + + ", fUpdateId=" + fUpdateId + + ", fUpdateTime=" + fUpdateTime + + ", fInspStatusName=" + fInspStatusName + + ", fInspId=" + fInspId + + ", fDate=" + fDate + + ", fFormDataRev=" + fFormDataRev + + "}"; + } +} diff --git a/backend/chkpower/src/main/resources/mapper/WCurrentReportMapper.xml b/backend/chkpower/src/main/resources/mapper/WCurrentReportMapper.xml new file mode 100644 index 0000000..0cf90fc --- /dev/null +++ b/backend/chkpower/src/main/resources/mapper/WCurrentReportMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID_, REF_ID_, F_notes, F_create_time, F_create_by, F_create_id, F_insp_time, F_insp_notes, F_insp_by, F_insp_by_id, F_update_by, F_update_id, F_update_time, F_insp_status_name, F_insp_id, F_date, F_form_data_rev_ + + + + + + + + + + diff --git a/backend/chkpower/src/main/resources/mapper/WFinanceMapper.xml b/backend/chkpower/src/main/resources/mapper/WFinanceMapper.xml index fe1326b..49cb1fb 100644 --- a/backend/chkpower/src/main/resources/mapper/WFinanceMapper.xml +++ b/backend/chkpower/src/main/resources/mapper/WFinanceMapper.xml @@ -72,4 +72,18 @@ AND acc.F_org_type= #{fOrgType} ORDER BY org.ORDER_NO_ ASC + + + UPDATE w_finance + SET F_insp_status_name = #{fInspStatusName}, + F_insp_time = #{fInspTime}, + F_insp_notes = #{fInspNotes}, + F_insp_id = #{fInspId}, + F_insp_by = #{fInspBy}, + F_update_time = #{fUpdateTime}, + F_update_by = #{fUpdateBy}, + F_update_id = #{fUpdateId} + WHERE DATE(F_date) = DATE(#{fDate}) + AND F_org_id = #{fOrgId} + diff --git a/frontend/front/src/api/service/dailyFunds.js b/frontend/front/src/api/service/dailyFunds.js new file mode 100644 index 0000000..4d85d78 --- /dev/null +++ b/frontend/front/src/api/service/dailyFunds.js @@ -0,0 +1,11 @@ +import request from '@/utils/request' + + +export function updateInsp(data) { + return request({ + url: `${context.portal}/wDailyFunds/v1/updateInsp`, + method: 'post', + data, + }) +} + diff --git a/frontend/front/src/components/tableSlot/dailyFunds/updateInspBtn.vue b/frontend/front/src/components/tableSlot/dailyFunds/updateInspBtn.vue new file mode 100644 index 0000000..784b6bc --- /dev/null +++ b/frontend/front/src/components/tableSlot/dailyFunds/updateInspBtn.vue @@ -0,0 +1,120 @@ + + + + + -- libgit2 0.21.2