Browse Source

2023-12-12 采集但后台接口,调整相关连的对象,增加数据联动接口查询,map数据映射

develop
zhousq 9 months ago
parent
commit
fd63c6f23f
  1. 2
      lzbi-admin/src/main/resources/application-dev.yml
  2. 219
      lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java
  3. 3
      lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java
  4. 3
      lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java
  5. 5
      lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java
  6. 12
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java
  7. 16
      lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java
  8. 131
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiBillModelMasterController.java
  9. 182
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java
  10. 85
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelMaster.java
  11. 135
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelSub.java
  12. 31
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillMaster.java
  13. 12
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java
  14. 89
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiBillModelMasterMapper.java
  15. 130
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiBillModelMasterService.java
  16. 3
      lzbi-module/src/main/java/com/lzbi/module/base/BaseModuleEntity.java
  17. 153
      lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java
  18. 2
      lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java
  19. 8
      lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java
  20. 13
      lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java
  21. 1
      lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java
  22. 4
      lzbi-module/src/main/java/com/lzbi/task/TaskParamDfratProcess.java
  23. 4
      lzbi-module/src/main/java/com/lzbi/task/TaskWorkParamRead.java
  24. 6
      lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml
  25. 3
      lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml
  26. 29
      lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml
  27. 184
      lzbi-module/src/main/resources/mapper/draft/DcBusiBillModelMasterMapper.xml
  28. 11
      lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml
  29. 3
      lzbi-system/src/main/java/com/lzbi/system/mapper/SysDeptMapper.java
  30. 2
      lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java
  31. 6
      lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java
  32. 5
      lzbi-system/src/main/resources/mapper/system/SysDeptMapper.xml

2
lzbi-admin/src/main/resources/application-dev.yml

@ -11,7 +11,7 @@ spring:
# 端口,默认为6379
port: 7000
# 数据库索引
database: 15
database: 14
# 密码
password: redis123
# 连接超时时间

219
lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java

@ -2,6 +2,11 @@ package com.lzbi.asset.domain;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lzbi.module.base.BaseModuleEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lzbi.common.annotation.Excel;
@ -13,49 +18,11 @@ import com.lzbi.common.core.domain.BaseEntity;
* @author Lu.JL
* @date 2023-11-27
*/
public class DcBaseAssetInfo extends BaseEntity {
@Data
//@TableName("dc_base_work_special")
public class DcBaseAssetInfo extends BaseModuleEntity {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
private String tenantId;
/**
* 乐观锁
*/
private Long REVISION;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除人
*/
private String deleteBy;
/**
* 删除时间
*/
private Date deleteTime;
@TableId(value = "id", type = IdType.AUTO)
/**
* 资产ID
*/
@ -114,172 +81,12 @@ public class DcBaseAssetInfo extends BaseEntity {
*/
@Excel(name = "所属组织结构")
private Long deptId;
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public String getTenantId() {
return tenantId;
}
public void setREVISION(Long REVISION) {
this.REVISION = REVISION;
}
public Long getREVISION() {
return REVISION;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getCreatedTime() {
return createdTime;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUpdatedTime() {
return updatedTime;
public String getValue() {
return this.assetCode;
}
public void setDeleteBy(String deleteBy) {
this.deleteBy = deleteBy;
}
public String getDeleteBy() {
return deleteBy;
}
public void setDeleteTime(Date deleteTime) {
this.deleteTime = deleteTime;
}
public Date getDeleteTime() {
return deleteTime;
}
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setAssetName(String assetName) {
this.assetName = assetName;
}
public String getAssetName() {
return assetName;
}
public void setAssetCode(String assetCode) {
this.assetCode = assetCode;
}
public String getAssetCode() {
return assetCode;
}
public void setAssetClass(String assetClass) {
this.assetClass = assetClass;
}
public String getAssetClass() {
return assetClass;
}
public void setFlagValidateDept(String flagValidateDept) {
this.flagValidateDept = flagValidateDept;
}
public String getFlagValidateDept() {
return flagValidateDept;
}
public void setFlagValidateRole(String flagValidateRole) {
this.flagValidateRole = flagValidateRole;
}
public String getFlagValidateRole() {
return flagValidateRole;
}
public void setFlagValidateUser(String flagValidateUser) {
this.flagValidateUser = flagValidateUser;
}
public String getFlagValidateUser() {
return flagValidateUser;
}
public void setStatusAsset(String statusAsset) {
this.statusAsset = statusAsset;
}
public String getStatusAsset() {
return statusAsset;
}
public void setComanyId(Long comanyId) {
this.comanyId = comanyId;
}
public Long getComanyId() {
return comanyId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getDeptId() {
return deptId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("tenantId", getTenantId())
.append("REVISION", getREVISION())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("deleteBy", getDeleteBy())
.append("deleteTime", getDeleteTime())
.append("id", getId())
.append("assetName", getAssetName())
.append("assetCode", getAssetCode())
.append("assetClass", getAssetClass())
.append("flagValidateDept", getFlagValidateDept())
.append("flagValidateRole", getFlagValidateRole())
.append("flagValidateUser", getFlagValidateUser())
.append("statusAsset", getStatusAsset())
.append("comanyId", getComanyId())
.append("deptId", getDeptId())
.toString();
public String getLabel() {
return this.assetName;
}
}

3
lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java

@ -3,6 +3,7 @@ package com.lzbi.asset.mapper;
import com.lzbi.asset.domain.DcBaseAssetInfo;
import java.util.HashMap;
import java.util.List;
/**
@ -20,6 +21,8 @@ public interface DcBaseAssetInfoMapper {
*/
public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id);
public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetcode);
public HashMap<String,String> selectDcBaseAssetInfoMap();
/**
* 查询资产信息列表
*

3
lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java

@ -3,6 +3,7 @@ package com.lzbi.asset.service;
import com.lzbi.asset.domain.DcBaseAssetInfo;
import java.util.HashMap;
import java.util.List;
/**
@ -20,6 +21,8 @@ public interface IDcBaseAssetInfoService {
*/
public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id);
public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode);
//add by zhousq 2023-12-12 获取资产信息Map映射便于存储查询
public HashMap<String,String> selectDcBaseAssetInfoMap();
/**
* 查询资产信息列表
*

5
lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java

@ -1,5 +1,6 @@
package com.lzbi.asset.service.impl;
import java.util.HashMap;
import java.util.List;
import com.lzbi.asset.domain.DcBaseAssetInfo;
@ -33,6 +34,10 @@ public class DcBaseAssetInfoServiceImpl implements IDcBaseAssetInfoService {
public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode) {
return dcBaseAssetInfoMapper.selectDcBaseAssetInfoByCode(assetCode);
}
@Override
public HashMap<String,String> selectDcBaseAssetInfoMap(){
return dcBaseAssetInfoMapper.selectDcBaseAssetInfoMap();
}
/**
* 查询资产信息列表
*

12
lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java

@ -52,7 +52,7 @@ public class DcBusiDataScreenMainController extends BaseController{
@GetMapping("/coalLostRate")
public AjaxResult getCoalLostRate()
{
String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM");
String qdate= "2023-11";//DateUtil.format(DateUtil.date(),"yyyy-MM");
List<DcBusiDataScreenVo> maps = dcBusiDataScreenMainService.selectCoalLostByDate(qdate);
JSONArray product=new JSONArray();
JSONArray realcost=new JSONArray();
@ -81,7 +81,7 @@ public class DcBusiDataScreenMainController extends BaseController{
@GetMapping("/powerInfoAll")
public AjaxResult getPowerInfoAll()
{
String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM");
String qdate= "2023-11"; //DateUtil.format(DateUtil.date(),"yyyy-MM");
List<DcBusiDataScreenVo> maps = dcBusiDataScreenMainService.selectPowerAll(qdate);
JSONArray list=new JSONArray();
AtomicReference<String> unit = new AtomicReference<>();
@ -103,7 +103,7 @@ public class DcBusiDataScreenMainController extends BaseController{
@GetMapping("/squareInfoCompany")
public AjaxResult getSquareInfoCompany()
{
String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM");
String qdate= "2023-11"; //DateUtil.format(DateUtil.date(),"yyyy-MM");
List<DcBusiDataScreenVo> real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate);
List<DcBusiDataScreenVo> self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate);
List<DcBusiDataScreenVo> group = dcBusiDataScreenMainService.selectSquareGroup(qdate);
@ -144,7 +144,7 @@ public class DcBusiDataScreenMainController extends BaseController{
@GetMapping("/squareInfoGroup")
public AjaxResult getSquareInfoGroup()
{
String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM");
String qdate= "2023-11";//DateUtil.format(DateUtil.date(),"yyyy-MM");
List<DcBusiDataScreenVo> real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate);
List<DcBusiDataScreenVo> self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate);
List<DcBusiDataScreenVo> group = dcBusiDataScreenMainService.selectSquareGroup(qdate);
@ -221,7 +221,7 @@ public class DcBusiDataScreenMainController extends BaseController{
* */
@GetMapping("/powerLostRate")
public AjaxResult getPowerLostRate(){
String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM");
String qdate= "2023-11";//DateUtil.format(DateUtil.date(),"yyyy-MM");
List<DcBusiDataScreenVo> data = dcBusiDataScreenMainService.selectDataPowerLost(qdate);
JSONArray product=new JSONArray();
JSONArray realcost=new JSONArray();
@ -246,7 +246,7 @@ public class DcBusiDataScreenMainController extends BaseController{
* */
@GetMapping("/waterInfo")
public AjaxResult getWaterInfo(){
String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM");
String qdate= "2023-11";// DateUtil.format(DateUtil.date(),"yyyy-MM");
List<DcBusiDataScreenVo> data_1 = dcBusiDataScreenMainService.selectDataWaterLostFirst(qdate);
List<DcBusiDataScreenVo> data_2 = dcBusiDataScreenMainService.selectDataWaterLostSecond(qdate);
List<DcBusiDataScreenVo> data_3 = dcBusiDataScreenMainService.selectDataWaterLostStationAll(qdate);

16
lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java

@ -19,6 +19,7 @@ import org.springframework.lang.Nullable;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Optional;
/**
* @auth create by Administrator
@ -104,8 +105,8 @@ public class SelectOptionsControl extends BaseController {
{
DcBaseAssetInfo dcBaseAssetInfo=new DcBaseAssetInfo();
//dcBaseAssetInfo.setAssetClass(assetQueryParams.getFieldCode());
dcBaseAssetInfo.setComanyId(assetQueryParams.getCompanyID());
dcBaseAssetInfo.setDeptId(assetQueryParams.getOrgID());
dcBaseAssetInfo.setComanyId(Optional.ofNullable(assetQueryParams.getCompanyID()).orElse(0L));
dcBaseAssetInfo.setDeptId(Optional.ofNullable(assetQueryParams.getOrgID()).orElse(0L));
return AjaxResult.success(dcBaseAssetInfoService.selectDcBaseAssetInfoList(dcBaseAssetInfo));
}
//根据条件获取统计单元指标列表
@ -115,6 +116,17 @@ public class SelectOptionsControl extends BaseController {
{
DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao();
dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode());
dcBaseAssetTargetDao.setColumnType(null);
//dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId());
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao));
}
@PostMapping("/assetParam/list")
public AjaxResult getAssetParamSelectList(@RequestBody AssetQueryParams assetQueryParams)
{
DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao();
dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode());
dcBaseAssetTargetDao.setTargetField(assetQueryParams.getFieldCode());
dcBaseAssetTargetDao.setColumnType("P");
//dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId());
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao));
}

131
lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiBillModelMasterController.java

@ -0,0 +1,131 @@
package com.lzbi.draft.controller;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.enums.BusinessType;
import com.lzbi.draft.domain. DcBusiBillModelMaster;
import com.lzbi.draft.service.DcBusiBillModelMasterService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
/**
* 录入配置Controller
*
* @author zhousq
* @date 2023-12-11
*/
@RestController
@RequestMapping("/draft/billModel")
public class DcBusiBillModelMasterController extends BaseController
{
@Autowired
private DcBusiBillModelMasterService dcBusiBillModelMasterService;
/**
* 查询录入配置列表
*/
@ApiOperation("查询录入配置列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiBillModelMaster", value = "", dataType = "DcBusiBillModelMaster", dataTypeClass = DcBusiBillModelMaster.class),
})
//@PreAuthorize("@ss.hasPermi('draft:billModel:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiBillModelMaster DcBusiBillModelMaster)
{
startPage();
List< DcBusiBillModelMaster> list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(DcBusiBillModelMaster);
return getDataTable(list);
}
/**
* 导出录入配置列表
*/
@ApiOperation("导出录入配置列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiBillModelMaster", value = "", dataType = "DcBusiBillModelMaster", dataTypeClass = DcBusiBillModelMaster.class),
})
//@PreAuthorize("@ss.hasPermi('draft:billModel:export')")
@Log(title = "录入配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response,DcBusiBillModelMaster DcBusiBillModelMaster)
{
List<DcBusiBillModelMaster> list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(DcBusiBillModelMaster);
ExcelUtil<DcBusiBillModelMaster> util = new ExcelUtil<DcBusiBillModelMaster>(DcBusiBillModelMaster.class);
util.exportExcel(response, list, "录入配置数据");
}
/**
* 获取录入配置详细信息
*/
@ApiOperation("获取录入配置详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class),
})
// @PreAuthorize("@ss.hasPermi('draft:billModel:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiBillModelMasterService.selectDcBusiBillModelMasterById(id));
}
/**
* 新增录入配置
*/
@ApiOperation("新增录入配置")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiBillModelMaster", value = "", dataType = "DcBusiBillModelMaster", dataTypeClass = DcBusiBillModelMaster.class),
})
//@PreAuthorize("@ss.hasPermi('draft:billModel:add')")
@Log(title = "录入配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiBillModelMaster DcBusiBillModelMaster)
{
return toAjax(dcBusiBillModelMasterService.insertDcBusiBillModelMaster(DcBusiBillModelMaster));
}
/**
* 修改录入配置
*/
@ApiOperation("修改录入配置")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiBillModelMaster", value = "", dataType = "DcBusiBillModelMaster", dataTypeClass = DcBusiBillModelMaster.class),
})
//@PreAuthorize("@ss.hasPermi('draft:billModel:edit')")
@Log(title = "录入配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiBillModelMaster DcBusiBillModelMaster)
{
return toAjax(dcBusiBillModelMasterService.updateDcBusiBillModelMaster(DcBusiBillModelMaster));
}
/**
* 删除录入配置
*/
@ApiOperation("删除录入配置")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class),
})
//@PreAuthorize("@ss.hasPermi('draft:billModel:remove')")
@Log(title = "录入配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiBillModelMasterService.deleteDcBusiBillModelMasterByIds(ids));
}
}

182
lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java

@ -1,19 +1,38 @@
package com.lzbi.draft.controller;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.lzbi.code.domain.DcBaseCoderuleDefineDao;
import com.lzbi.code.domain.DcBusiCoderuleConfigDao;
import com.lzbi.code.service.CodeNoGenerater;
import com.lzbi.code.service.DcBaseCoderuleDefineService;
import com.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.core.domain.model.LoginUser;
import com.lzbi.common.core.page.TableDataInfo;
import com.lzbi.common.enums.BusinessType;
import com.lzbi.common.utils.SecurityUtils;
import com.lzbi.common.utils.StringUtils;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.draft.domain.DcBusiBillModelMaster;
import com.lzbi.draft.domain.DcBusiBillModelSub;
import com.lzbi.draft.domain.DcBusiParamBillMaster;
import com.lzbi.draft.domain.DcBusiParamBillSub;
import com.lzbi.draft.service.DcBusiBillModelMasterService;
import com.lzbi.draft.service.DcBusiParamBillMasterService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
* 参数采集录入单据主Controller
@ -25,20 +44,177 @@ import java.util.List;
@RequestMapping("/draft/paramCollect")
public class DcBusiParamCollectBill extends BaseController
{
@Autowired
private DcBusiBillModelMasterService dcBusiBillModelMasterService;
@Autowired
private DcBusiParamBillMasterService dcBusiParamBillMasterService;
@Autowired
private DcBaseCoderuleDefineService dcBaseCoderuleDefineService;
@Autowired
private CodeNoGenerater codeNoGenerater;
/**
* 查询参数采集录入单据主列表
* 查询参数采集录入
* 根据
*/
@PreAuthorize("@ss.hasPermi('param:paramData:list')")
// @PreAuthorize("@ss.hasPermi('param:paramData:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiParamBillMaster dcBusiParamBillMasterDao)
{
startPage();
List<DcBusiParamBillMaster> list = dcBusiParamBillMasterService.selectDcBusiParamBillMasterDaoList(dcBusiParamBillMasterDao);
//List<DcBusiParamBillMaster> list = dcBusiParamBillMasterService.selectDcBusiParamBillMasterDaoList(dcBusiParamBillMasterDao);
return getDataTable(null);
}
/**
* 根据根据公司查询模版现根据用户名进行过滤
* 根据
*/
@ApiOperation("根据根据公司查询模版,现根据用户名进行过滤")
@ApiImplicitParams({
@ApiImplicitParam(name = "companyId", value = "", dataType = "Long", dataTypeClass = Long.class),
})
//@PreAuthorize("@ss.hasPermi('param:paramData:list')")
@GetMapping("/userModellist/{companyId}")
public TableDataInfo getUserModellist(@PathVariable Long companyId)
{
DcBusiBillModelMaster dcBusiBillModelMaster=new DcBusiBillModelMaster();
LoginUser loginUser = SecurityUtils.getLoginUser();
dcBusiBillModelMaster.setCreatedBy(loginUser.getUsername());
dcBusiBillModelMaster.setCompanyId(Optional.ofNullable(companyId).orElse(null));
//dcBusiBillModelMaster.setDeptId(loginUser.getDeptId());
//dcBusiBillModelMaster.setRoleId(loginUser.getUser().getRoleId());
startPage();
List<DcBusiBillModelMaster> list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(dcBusiBillModelMaster);
return getDataTable(list);
}
/**
* 根据根据公司查询模版现根据角色ID进行过滤
* 根据
*/
@ApiOperation("根据根据公司查询模版,现根据角色ID进行过滤")
@ApiImplicitParams({
@ApiImplicitParam(name = "companyId", value = "", dataType = "Long", dataTypeClass = Long.class),
})
//@PreAuthorize("@ss.hasPermi('param:paramData:list')")
@GetMapping("/roleModellist/{companyId}")
public TableDataInfo getRoleModellist(@PathVariable Long companyId)
{
DcBusiBillModelMaster dcBusiBillModelMaster=new DcBusiBillModelMaster();
LoginUser loginUser = SecurityUtils.getLoginUser();
dcBusiBillModelMaster.setCompanyId(Optional.ofNullable(companyId).orElse(null));
dcBusiBillModelMaster.setRoleId(loginUser.getUser().getRoleId());
startPage();
List<DcBusiBillModelMaster> list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(dcBusiBillModelMaster);
return getDataTable(list);
}
@ApiOperation("根据单据模版编号获取模版内容信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "modelNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@GetMapping("/getBillModelDetail/{modelNo}")
public AjaxResult getBillModelDetail(@PathVariable String modelNo){
List<DcBusiBillModelSub> list=new ArrayList<>();
return AjaxResult.success();
}
@ApiOperation("保存配置模版")
@ApiImplicitParams({
@ApiImplicitParam(name = "dcBusiParamBillMaster", value = "", dataType = "DcBusiParamBillMaster", dataTypeClass = DcBusiParamBillMaster.class),
})
@PostMapping("/saveBillModel")
public AjaxResult saveBillModel(@RequestBody DcBusiParamBillMaster dcBusiParamBillMaster){
LoginUser loginUser = SecurityUtils.getLoginUser();
String billModelNo=Optional.ofNullable(getBillModelNo()).orElse(StringUtils.leftPad(String.valueOf(dcBusiParamBillMaster.getCompanyId()),4)+"#"+DateUtil.formatDateTime(DateUtil.date()));
DcBusiBillModelMaster dcBusiBillModelMaster=new DcBusiBillModelMaster();
dcBusiBillModelMaster.setCreatedTime(DateUtil.date());
dcBusiBillModelMaster.setCreatedBy(loginUser.getUsername());
dcBusiBillModelMaster.setBillModelPoint(dcBusiParamBillMaster.getCountTimes());
dcBusiBillModelMaster.setRoleId(loginUser.getUser().getRoleId());
dcBusiBillModelMaster.setDeptId(loginUser.getDeptId());
dcBusiBillModelMaster.setCompanyId(dcBusiParamBillMaster.getCompanyId());
dcBusiBillModelMaster.setCompanyName(dcBusiParamBillMaster.getCompanyName());
dcBusiBillModelMaster.setOrgId(dcBusiParamBillMaster.getOragnizeId());
dcBusiBillModelMaster.setOrgName(dcBusiBillModelMaster.getOrgName());
dcBusiBillModelMaster.setDataState("0");
dcBusiBillModelMaster.setUseState("1");
dcBusiBillModelMaster.setFieldCode(dcBusiParamBillMaster.getFieldCode());
dcBusiBillModelMaster.setFieldName(dcBusiParamBillMaster.getFieldName());
dcBusiBillModelMaster.setBillModelNo(billModelNo);
dcBusiBillModelMaster.setBillModelName(dcBusiParamBillMaster.getBillName());
List<DcBusiBillModelSub> dcBusiBillModelSubList=new ArrayList<>();
List<DcBusiParamBillSub> dcBusiParamBillSubList = dcBusiParamBillMaster.getDcBusiParamBillSubList();
dcBusiParamBillSubList.forEach(item -> {
DcBusiBillModelSub modelSub=new DcBusiBillModelSub();
modelSub.setBillModelNo(billModelNo);
modelSub.setAssetCode(item.getAssetCode());
modelSub.setAssetName(item.getAssetName());
//modelSub.setAssetId(item.get);
modelSub.setAssetUnitCode(item.getParamCode());
modelSub.setAssetUnitName(item.getParamName());
modelSub.setAssetUnitType("P");
dcBusiBillModelSubList.add(modelSub);
});
dcBusiBillModelMaster.setDcBusiBillModelSubList(dcBusiBillModelSubList);
return AjaxResult.success(dcBusiBillModelMasterService.insertDcBusiBillModelMaster(dcBusiBillModelMaster));
}
@ApiOperation("保存参数采集数据-直接对象方式")
@ApiImplicitParams({
@ApiImplicitParam(name = "dcBusiParamBillMaster", value = "", dataType = "DcBusiParamBillMaster", dataTypeClass = DcBusiParamBillMaster.class),
})
@PostMapping("/saveBillCollectObj")
public AjaxResult saveBillCollectByObj(@RequestBody DcBusiParamBillMaster dcBusiParamBillMaster){
dcBusiParamBillMaster.setId(null);
return AjaxResult.success(dcBusiParamBillMasterService.insertDcBusiParamBillMasterDao(dcBusiParamBillMaster));
}
@ApiOperation("保存参数采集数据-subDatas数组方式")
@ApiImplicitParams({
@ApiImplicitParam(name = "dcBusiParamBillMaster", value = "", dataType = "DcBusiParamBillMaster", dataTypeClass = DcBusiParamBillMaster.class),
})
@PostMapping("/saveBillCollectArray")
/*subDatas为动态数据列,值是分开的索要对每个列值进行处理*/
public AjaxResult saveBillCollectBy(@RequestBody DcBusiParamBillMaster dcBusiParamBillMaster){
List<DcBusiParamBillSub> dcBusiParamBillSubList =new ArrayList<>();
String billNo=dcBusiParamBillMaster.getBillNo();
String fieldCode=dcBusiParamBillMaster.getFieldCode();
String fieldName=dcBusiParamBillMaster.getFieldName();
String countDate=dcBusiParamBillMaster.getCountDate();
dcBusiParamBillMaster.setBillIncomeDate(countDate);
dcBusiParamBillMaster.setCreatedBy(SecurityUtils.getLoginUser().getUsername());
JSONArray jsonArray=Optional.ofNullable(JSONArray.from(dcBusiParamBillMaster.getSubDatas())).orElse(new JSONArray());
jsonArray.forEach(item->{
JSONObject jsb = JSONObject.from(item);
for(int i=1;i<25;i++){
String fname="val_"+String.valueOf(i);
Double value=jsb.getDouble(fname);
if(StringUtils.isNotNull(value)){
DcBusiParamBillSub dcBusiParamBillSub=new DcBusiParamBillSub();
//基本数据
dcBusiParamBillSub.setBillNo(billNo);
dcBusiParamBillSub.setId(null);
dcBusiParamBillSub.setParamCode(jsb.getString("paramCode"));
dcBusiParamBillSub.setAssetCode(jsb.getString("assetCode"));
dcBusiParamBillSub.setAssetName(jsb.getString("assetName"));
//dcBusiParamBillSub.setCountDate(jsb.getString("countDate"));
dcBusiParamBillSub.setCountDate(countDate);
dcBusiParamBillSub.setParamUint(jsb.getString("paramUint"));
dcBusiParamBillSub.setParamName(jsb.getString("paramName"));
dcBusiParamBillSub.setFieldCode(fieldCode);
dcBusiParamBillSub.setFieldName(fieldName);
dcBusiParamBillSub.setCountHour(i);
dcBusiParamBillSub.setParamValue(value);
dcBusiParamBillSubList.add(dcBusiParamBillSub);
}
}
});
dcBusiParamBillMaster.setDcBusiParamBillSubList(dcBusiParamBillSubList);
return AjaxResult.success(dcBusiParamBillMasterService.insertDcBusiParamBillMasterDao(dcBusiParamBillMaster));
}
private String getBillModelNo(){
DcBusiCoderuleConfigDao ruleIdByBusicode = dcBaseCoderuleDefineService.getRuleIdByBusicode("BILL_MODEL_NO");
DcBaseCoderuleDefineDao ruleDao = dcBaseCoderuleDefineService.selectDcBaseCoderuleDefineDaoById(ruleIdByBusicode.getRuleId());
return codeNoGenerater.getCode(ruleDao);
}
}

85
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelMaster.java

@ -0,0 +1,85 @@
package com.lzbi.draft.domain;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import lombok.Data;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 录入配置对象 dc_busi_bill_model_master
*
* @author zhousq
* @date 2023-12-11
*/
@Data
public class DcBusiBillModelMaster extends BaseModuleEntity
{
/** 主键 */
@ApiModelProperty(name = "主键",notes = "")
@TableId(type= IdType.AUTO)
private Long id ;
private static final long serialVersionUID = 1L;
/** 部门Id */
@Excel(name = "部门Id")
private Long deptId;
/** 角色ID */
@Excel(name = "角色ID")
private Long roleId;
/** 任务模版编号 */
@Excel(name = "任务模版编号")
private String billModelNo;
/** 任务模版名称 */
@Excel(name = "任务模版名称")
private String billModelName;
/** 所属专业编码 */
@Excel(name = "所属专业编码")
private String fieldCode;
/** 所属公司名称 */
@Excel(name = "所属公司名称")
private String companyName;
/** 所属公司ID */
@Excel(name = "所属公司ID")
private Long companyId;
/** 任务整点 */
@Excel(name = "任务整点")
private String billModelPoint;
/** 所属组织名称 */
@Excel(name = "所属组织名称")
private String orgName;
/** 所属组织ID */
@Excel(name = "所属组织ID")
private Long orgId;
/** 数据状态 */
@Excel(name = "数据状态")
private String dataState;
/** 使用状态 */
@Excel(name = "使用状态")
private String useState;
/** 所属专业名称 */
@Excel(name = "所属专业名称")
private String fieldName;
/** 数据录入单模版子信息 */
private List<DcBusiBillModelSub> dcBusiBillModelSubList;
}

135
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelSub.java

@ -0,0 +1,135 @@
package com.lzbi.draft.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 数据录入单模版子对象 dc_busi_bill_model_sub
*
* @author zhousq
* @date 2023-12-11
*/
public class DcBusiBillModelSub extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 模版编码号 */
@Excel(name = "模版编码号")
private String billModelNo;
/** 统计单元编码 */
@Excel(name = "统计单元编码")
private String assetCode;
/** 统计单元名称 */
@Excel(name = "统计单元名称")
private String assetName;
/** 指标【参数】编码 */
@Excel(name = "指标【参数】编码")
private String assetUnitCode;
/** 指标【参数】名称 */
@Excel(name = "指标【参数】名称")
private String assetUnitName;
/** 数据类别;T指标P参数 */
@Excel(name = "数据类别;T指标P参数")
private String assetUnitType;
/** 主键 */
private Long id;
/** 统计单元ID */
@Excel(name = "统计单元ID")
private Long assetId;
public void setBillModelNo(String billModelNo)
{
this.billModelNo = billModelNo;
}
public String getBillModelNo()
{
return billModelNo;
}
public void setAssetCode(String assetCode)
{
this.assetCode = assetCode;
}
public String getAssetCode()
{
return assetCode;
}
public void setAssetName(String assetName)
{
this.assetName = assetName;
}
public String getAssetName()
{
return assetName;
}
public void setAssetUnitCode(String assetUnitCode)
{
this.assetUnitCode = assetUnitCode;
}
public String getAssetUnitCode()
{
return assetUnitCode;
}
public void setAssetUnitName(String assetUnitName)
{
this.assetUnitName = assetUnitName;
}
public String getAssetUnitName()
{
return assetUnitName;
}
public void setAssetUnitType(String assetUnitType)
{
this.assetUnitType = assetUnitType;
}
public String getAssetUnitType()
{
return assetUnitType;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAssetId(Long assetId)
{
this.assetId = assetId;
}
public Long getAssetId()
{
return assetId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("billModelNo", getBillModelNo())
.append("assetCode", getAssetCode())
.append("assetName", getAssetName())
.append("assetUnitCode", getAssetUnitCode())
.append("assetUnitName", getAssetUnitName())
.append("assetUnitType", getAssetUnitType())
.append("id", getId())
.append("assetId", getAssetId())
.toString();
}
}

31
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillMaster.java

@ -1,5 +1,6 @@
package com.lzbi.draft.domain;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -49,7 +50,7 @@ public class DcBusiParamBillMaster extends BaseModuleEntity
private String checkStatus ;
/** 公司ID */
@ApiModelProperty(name = "公司ID",notes = "")
private Integer companyId ;
private Long companyId ;
/** 公司名称 */
@ApiModelProperty(name = "公司名称",notes = "")
private String companyName ;
@ -58,17 +59,27 @@ public class DcBusiParamBillMaster extends BaseModuleEntity
private String organizeName ;
/** 组织机构ID */
@ApiModelProperty(name = "组织机构ID",notes = "")
private Integer oragnizeId ;
/** 统计单元编码 */
@ApiModelProperty(name = "统计单元编码",notes = "")
private String assetCode ;
/** 统计单元名称 */
@ApiModelProperty(name = "统计单元名称",notes = "")
private String assetName ;
private Long oragnizeId ;
/** 统计单元编码 --不在主单据中了*/
// @ApiModelProperty(name = "统计单元编码",notes = "")
// private String assetCode ;
// /** 统计单元名称 */
// @ApiModelProperty(name = "统计单元名称",notes = "")
// private String assetName ;
@ApiModelProperty(name = "单据名称",notes = "")
private String billName ;
@ApiModelProperty(name = "统计日期",notes = "")
private String countDate ;
@ApiModelProperty(name = "统计整点数",notes = "")
private String countTimes;
@ApiModelProperty(name = "专业编码",notes = "")
private String fieldCode;
@ApiModelProperty(name = "专业名称",notes = "")
private String fieldName;
/** 参数数据采集(录入)明细信息 */
private List<DcBusiParamBillSub> dcBusiParamBillSubList;
@ApiModelProperty(name = "data数组数据未转换",notes = "")
private JSONArray subDatas;

12
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java

@ -41,8 +41,11 @@ public class DcBusiParamBillSub extends BaseModuleEntity{
@ApiModelProperty(name = "统计单元名称",notes = "")
private String assetName ;
/** 所属专业 */
@ApiModelProperty(name = "所属专业",notes = "")
private String fieldType ;
@ApiModelProperty(name = "所属专业编码",notes = "")
private String fieldCode ;
/** 所属专业 */
@ApiModelProperty(name = "所属专业名称",notes = "")
private String fieldName ;
/** 指标名称 */
@ApiModelProperty(name = "指标名称",notes = "")
private String paramName ;
@ -60,6 +63,7 @@ public class DcBusiParamBillSub extends BaseModuleEntity{
private String countDate ;
@ApiModelProperty(name = "统计小时",notes = "24小时")
private Integer countHour ;
public String getAssetCode(){
return Optional.ofNullable(this.assetCode).orElse("");
}
@ -69,7 +73,7 @@ public class DcBusiParamBillSub extends BaseModuleEntity{
public String getCountDate(){
return Optional.ofNullable(this.countDate).orElse("");
}
public String getFieldType(){
return Optional.ofNullable(this.fieldType).orElse("");
public String getFieldCode(){
return Optional.ofNullable(this.fieldCode).orElse("");
}
}

89
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiBillModelMasterMapper.java

@ -0,0 +1,89 @@
package com.lzbi.draft.mapper;
import java.util.List;
import com.lzbi.draft.domain.DcBusiBillModelMaster;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.draft.domain.DcBusiBillModelSub;
/**
* 录入配置Mapper接口
*
* @author zhousq
* @date 2023-12-11
*/
public interface DcBusiBillModelMasterMapper extends BaseMapper<DcBusiBillModelMaster>
{
/**
* 查询录入配置
*
* @param id 录入配置主键
* @return 录入配置
*/
public DcBusiBillModelMaster selectDcBusiBillModelMasterById(Long id);
/**
* 查询录入配置列表
*
* @param dcBusiBillModelMaster 录入配置
* @return 录入配置集合
*/
public List<DcBusiBillModelMaster> selectDcBusiBillModelMasterList(DcBusiBillModelMaster dcBusiBillModelMaster);
/**
* 新增录入配置
*
* @param dcBusiBillModelMaster 录入配置
* @return 结果
*/
public int insertDcBusiBillModelMaster(DcBusiBillModelMaster dcBusiBillModelMaster);
/**
* 修改录入配置
*
* @param dcBusiBillModelMaster 录入配置
* @return 结果
*/
public int updateDcBusiBillModelMaster(DcBusiBillModelMaster dcBusiBillModelMaster);
/**
* 删除录入配置
*
* @param id 录入配置主键
* @return 结果
*/
public int deleteDcBusiBillModelMasterById(Long id);
/**
* 批量删除录入配置
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiBillModelMasterByIds(Long[] ids);
/**
* 批量删除数据录入单模版子
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiBillModelSubByBillModelNos(Long[] ids);
/**
* 批量新增数据录入单模版子
*
* @param dcBusiBillModelSubList 数据录入单模版子列表
* @return 结果
*/
public int batchDcBusiBillModelSub(List<DcBusiBillModelSub> dcBusiBillModelSubList);
/**
* 通过录入配置主键删除数据录入单模版子信息
*
* @param id 录入配置ID
* @return 结果
*/
public int deleteDcBusiBillModelSubByBillModelNo(Long id);
}

130
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiBillModelMasterService.java

@ -0,0 +1,130 @@
package com.lzbi.draft.service;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.lzbi.common.utils.DateUtils;
import org.springframework.transaction.annotation.Transactional;
import com.lzbi.draft.domain.DcBusiBillModelSub;
import com.lzbi.draft.domain.DcBusiBillModelMaster;
import com.lzbi.draft.mapper.DcBusiBillModelMasterMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 录入配置Service业务层处理
*
* @author zhousq
* @date 2023-12-11
*/
@Service
public class DcBusiBillModelMasterService extends ServiceImpl<DcBusiBillModelMasterMapper, DcBusiBillModelMaster> implements IService<DcBusiBillModelMaster>
{
/**
* 查询录入配置
*
* @param id 录入配置主键
* @return 录入配置
*/
public DcBusiBillModelMaster selectDcBusiBillModelMasterById(Long id)
{
return baseMapper.selectDcBusiBillModelMasterById(id);
}
/**
* 查询录入配置列表
*
* @param dcBusiBillModelMaster 录入配置
* @return 录入配置
*/
public List<DcBusiBillModelMaster> selectDcBusiBillModelMasterList(DcBusiBillModelMaster dcBusiBillModelMaster)
{
return baseMapper.selectDcBusiBillModelMasterList(dcBusiBillModelMaster);
}
/**
* 新增录入配置
*
* @param dcBusiBillModelMaster 录入配置
* @return 结果
*/
@Transactional
public int insertDcBusiBillModelMaster(DcBusiBillModelMaster dcBusiBillModelMaster)
{
dcBusiBillModelMaster.setCreatedTime(DateUtils.getNowDate());
int rows = baseMapper.insertDcBusiBillModelMaster(dcBusiBillModelMaster);
insertDcBusiBillModelSub(dcBusiBillModelMaster);
return rows;
}
/**
* 修改录入配置
*
* @param dcBusiBillModelMaster 录入配置
* @return 结果
*/
@Transactional
public int updateDcBusiBillModelMaster(DcBusiBillModelMaster dcBusiBillModelMaster)
{
dcBusiBillModelMaster.setUpdatedTime(DateUtils.getNowDate());
baseMapper.deleteDcBusiBillModelSubByBillModelNo(dcBusiBillModelMaster.getId());
insertDcBusiBillModelSub(dcBusiBillModelMaster);
return baseMapper.updateDcBusiBillModelMaster(dcBusiBillModelMaster);
}
/**
* 批量删除录入配置
*
* @param ids 需要删除的录入配置主键
* @return 结果
*/
@Transactional
public int deleteDcBusiBillModelMasterByIds(Long[] ids)
{
baseMapper.deleteDcBusiBillModelSubByBillModelNos(ids);
return baseMapper.deleteDcBusiBillModelMasterByIds(ids);
}
/**
* 删除录入配置信息
*
* @param id 录入配置主键
* @return 结果
*/
@Transactional
public int deleteDcBusiBillModelMasterById(Long id)
{
baseMapper.deleteDcBusiBillModelSubByBillModelNo(id);
return baseMapper.deleteDcBusiBillModelMasterById(id);
}
/**
* 新增数据录入单模版子信息
*
* @param dcBusiBillModelMaster 录入配置对象
*/
public void insertDcBusiBillModelSub(DcBusiBillModelMaster dcBusiBillModelMaster)
{
List<DcBusiBillModelSub> dcBusiBillModelSubDaoList = dcBusiBillModelMaster.getDcBusiBillModelSubList();
String billNo = dcBusiBillModelMaster.getBillModelNo();
if (StringUtils.isNotNull(dcBusiBillModelSubDaoList))
{
List<DcBusiBillModelSub> list = new ArrayList<DcBusiBillModelSub>();
for (DcBusiBillModelSub dcBusiBillModelSubDao : dcBusiBillModelSubDaoList)
{
dcBusiBillModelSubDao.setBillModelNo(billNo);
list.add(dcBusiBillModelSubDao);
}
if (list.size() > 0)
{
baseMapper.batchDcBusiBillModelSub(list);
}
}
}
}

3
lzbi-module/src/main/java/com/lzbi/module/base/BaseModuleEntity.java

@ -1,5 +1,7 @@
package com.lzbi.module.base;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
@ -12,6 +14,7 @@ import java.util.Date;
* BaseModuleEntity
*/
public class BaseModuleEntity implements Serializable,Cloneable{
/** 租户号 */
@ApiModelProperty(name = "租户号",notes = "")
private String tenantId ;

153
lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java

@ -4,6 +4,12 @@ import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lzbi.common.annotation.Excel;
@ -15,34 +21,15 @@ import com.lzbi.module.base.BaseModuleEntity;
* @author win
* @date 2023-11-28
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "参数数据采集(录入)明细表",description = "")
@TableName("dc_base_work_special")
public class DcBaseWorkSpecial extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 租户号 */
private String tenantId;
/** 乐观锁 */
private Long REVISION;
/** 创建人 */
private String createdBy;
/** 创建时间 */
private Date createdTime;
/** 更新人 */
private String updatedBy;
/** 更新时间 */
private Date updatedTime;
/** 删除人 */
private String deleteBy;
/** 删除时间 */
private Date deleteTime;
@TableId(value = "id", type = IdType.AUTO)
/** 主键 */
private Long id;
@ -55,120 +42,4 @@ public class DcBaseWorkSpecial extends BaseModuleEntity
@Excel(name = "专业名称")
private String specialName;
public void setTenantId(String tenantId)
{
this.tenantId = tenantId;
}
public String getTenantId()
{
return tenantId;
}
public void setREVISION(Long REVISION)
{
this.REVISION = REVISION;
}
public Long getREVISION()
{
return REVISION;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
public void setUpdatedBy(String updatedBy)
{
this.updatedBy = updatedBy;
}
public String getUpdatedBy()
{
return updatedBy;
}
public void setUpdatedTime(Date updatedTime)
{
this.updatedTime = updatedTime;
}
public Date getUpdatedTime()
{
return updatedTime;
}
public void setDeleteBy(String deleteBy)
{
this.deleteBy = deleteBy;
}
public String getDeleteBy()
{
return deleteBy;
}
public void setDeleteTime(Date deleteTime)
{
this.deleteTime = deleteTime;
}
public Date getDeleteTime()
{
return deleteTime;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setSpecialCode(String specialCode)
{
this.specialCode = specialCode;
}
public String getSpecialCode()
{
return specialCode;
}
public void setSpecialName(String specialName)
{
this.specialName = specialName;
}
public String getSpecialName()
{
return specialName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("tenantId", getTenantId())
.append("REVISION", getREVISION())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("deleteBy", getDeleteBy())
.append("deleteTime", getDeleteTime())
.append("id", getId())
.append("specialCode", getSpecialCode())
.append("specialName", getSpecialName())
.toString();
}
}

2
lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java

@ -1,5 +1,6 @@
package com.lzbi.special.mapper;
import java.util.HashMap;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -71,4 +72,5 @@ public interface DcBaseWorkSpecialMapper extends BaseMapper<DcBaseWorkSpecial>
* @return 结果
*/
public int deleteDcBaseWorkSpecialByIds(Long[] ids);
public HashMap<String,String> getDcBaseWorkSpecialMap();
}

8
lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java

@ -1,5 +1,6 @@
package com.lzbi.special.service;
import java.util.HashMap;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
@ -99,4 +100,11 @@ public class DcBaseWorkSpecialService extends ServiceImpl<DcBaseWorkSpecialMappe
{
return baseMapper.deleteDcBaseWorkSpecialById(id);
}
/**
* 一次性获取专业的字典缓存方便映射查询
*/
public HashMap<String,String> getDcBaseWorkSpecialMap(){
return baseMapper.getDcBaseWorkSpecialMap();
}
}

13
lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java

@ -2,6 +2,10 @@ package com.lzbi.targetFolder.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
@ -16,7 +20,7 @@ import com.lzbi.module.base.BaseModuleEntity;
public class DcBaseAssetTargetDao extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
/** 主键 */
private Long id;
@ -71,6 +75,13 @@ public class DcBaseAssetTargetDao extends BaseModuleEntity
/** 统计单元编码 */
@Excel(name = "统计单元编码")
private String assetCode;
//add by zhousq 2023-12-12
@ApiModelProperty("所属专业名称")
private String targetFieldName;
@ApiModelProperty("单位")
private String fieldUnit;
@ApiModelProperty("字段类型")
private String columnType;
private String value;
private String label;

1
lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java

@ -31,6 +31,7 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
*/
public List<DcBaseAssetTargetDao> selectDcBaseAssetTargetDaoList(DcBaseAssetTargetDao dcBaseAssetTargetDao);
/**
* 新增资产指标配置
*

4
lzbi-module/src/main/java/com/lzbi/task/TaskParamDfratProcess.java

@ -36,7 +36,7 @@ public class TaskParamDfratProcess {
DcBusiParamBillSub billSub=new DcBusiParamBillSub();
billSub.setBillNo(billMasterDao.getBillNo());
List<DcBusiParamBillSub> dcBusiParamBillSubs = dcBusiParamBillSubService.selectByVo(billSub);
Map<String, List<DcBusiParamBillSub>> collect = dcBusiParamBillSubs.stream().collect(Collectors.groupingBy(gp -> gp.getAssetCode() + ":" + gp.getParamCode() + ":" + gp.getFieldType() + ":" + gp.getCountDate()));
Map<String, List<DcBusiParamBillSub>> collect = dcBusiParamBillSubs.stream().collect(Collectors.groupingBy(gp -> gp.getAssetCode() + ":" + gp.getParamCode() + ":" + gp.getFieldCode() + ":" + gp.getCountDate()));
collect.forEach((key,value)->{
String[] s=key.split(":");
ParamDraftQueryVo queryVo=new ParamDraftQueryVo();
@ -50,7 +50,7 @@ public class TaskParamDfratProcess {
if(StringUtils.isNull(dcBusiParamDraftDay.getId())){
dcBusiParamDraftDay.setCreatedTime(DateUtil.date());
dcBusiParamDraftDay.setCreatedBy("task");
dcBusiParamDraftDay.setParamFieldCode(val.getFieldType());
dcBusiParamDraftDay.setParamFieldCode(val.getFieldCode());
dcBusiParamDraftDay.setParamCode(val.getParamCode());
dcBusiParamDraftDay.setCountDate(val.getCountDate());
dcBusiParamDraftDay.setAssetCode(val.getAssetCode());

4
lzbi-module/src/main/java/com/lzbi/task/TaskWorkParamRead.java

@ -21,6 +21,7 @@ import com.lzbi.task.service.WorkParamReadService;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@ -118,7 +119,7 @@ public class TaskWorkParamRead {
Double va=item.getValueByType(find.get().getGoalParamType());
subDao.setParamValue(va);
subDao.setParamCode(find.get().getAssetParamCode());
subDao.setFieldType(find.get().getAssetFieldCode());
subDao.setFieldCode(find.get().getAssetFieldCode());
subDao.setCountDate(item.getDateCount());
subDao.setCountHour(item.getHourCount());
billSub.add(subDao);
@ -127,4 +128,5 @@ public class TaskWorkParamRead {
billm.setDcBusiParamBillSubList(billSub);
return dcBusiParamBillMasterService.insertDcBusiParamBillMasterDao(billm);
}
}

6
lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml

@ -75,6 +75,12 @@
<include refid="selectDcBaseAssetInfoVo"/>
where asset_code = #{assetCode}
</select>
<!--add by zhousq 2023-12-12 -->
<select id="selectDcBaseAssetInfoMap" resultType="hashmap">
select asset_code,
asset_name
from dc_base_asset_info
</select>
<insert id="insertDcBaseAssetInfo" parameterType="DcBaseAssetInfo" useGeneratedKeys="true" keyProperty="id">
insert into dc_base_asset_info
<trim prefix="(" suffix=")" suffixOverrides=",">

3
lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml

@ -101,4 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getDcBaseWorkSpecialMap" resultType="hashmap">
select special_code, special_name from dc_base_work_special
</select>
</mapper>

29
lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml

@ -19,6 +19,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="billType" column="bill_type" />
<result property="checkType" column="check_type" />
<result property="checkStatus" column="check_status" />
<result property="companyId" column="company_id" />
<result property="companyName" column="companyName" />
<result property="organizeName" column="organize_name" />
<result property="oragnizeId" column="oragnize_id" />
</resultMap>
<resultMap id="DcBusiParamBillMasterDcBusiParamBillSubResult" type="DcBusiParamBillMaster" extends="DcBusiParamBillMasterResult">
@ -36,7 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="sub_id" />
<result property="billNo" column="sub_bill_no" />
<result property="assetCode" column="sub_asset_code" />
<result property="fieldType" column="sub_field_type" />
<result property="assetName" column="sub_asset_name" />
<result property="fieldCode" column="sub_field_code" />
<result property="fieldName" column="sub_field_name" />
<result property="countDate" column="sub_count_date" />
<result property="countHour" column="sub_count_hour" />
<result property="paramCode" column="sub_param_code" />
@ -61,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDcBusiParamBillMasterDaoById" parameterType="Long" resultMap="DcBusiParamBillMasterDcBusiParamBillSubResult">
select a.TENANT_ID, a.REVISION, a.CREATED_BY, a.CREATED_TIME, a.UPDATED_BY, a.UPDATED_TIME, a.DELETE_BY, a.DELETE_TIME, a.id, a.bill_no, a.bill_income_date, a.bill_type, a.check_type, a.check_status,
b.TENANT_ID as sub_TENANT_ID, b.CREATED_BY as sub_CREATED_BY, b.CREATED_TIME as sub_CREATED_TIME, b.UPDATED_BY as sub_UPDATED_BY, b.UPDATED_TIME as sub_UPDATED_TIME, b.DELETE_BY as sub_DELETE_BY, b.DELETE_TIME as sub_DELETE_TIME, b.id as sub_id, b.bill_no as sub_bill_no,b.asset_code as sub_asset_code, b.field_type as sub_field_type, b.param_code as sub_param_code, b.param_value as sub_param_value, b.count_date as sub_count_date, b.count_hour as sub_count_hour
b.TENANT_ID as sub_TENANT_ID, b.CREATED_BY as sub_CREATED_BY, b.CREATED_TIME as sub_CREATED_TIME, b.UPDATED_BY as sub_UPDATED_BY, b.UPDATED_TIME as sub_UPDATED_TIME, b.DELETE_BY as sub_DELETE_BY, b.DELETE_TIME as sub_DELETE_TIME, b.id as sub_id, b.bill_no as sub_bill_no,b.asset_code as sub_asset_code,b.asset_name as sub_asset_name, b.field_code as sub_field_code, b.field_name as sub_field_name, b.param_code as sub_param_code, b.param_value as sub_param_value, b.count_date as sub_count_date, b.count_hour as sub_count_hour
from dc_busi_param_bill_master a
left join dc_busi_param_bill_sub b on b.bill_no = a.bill_no
where a.id = #{id}
@ -71,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into dc_busi_param_bill_master
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tenantId != null">TENANT_ID,</if>
<if test="REVISION != null">REVISION,</if>
<if test="revision != null">REVISION,</if>
<if test="createdBy != null">CREATED_BY,</if>
<if test="createdTime != null">CREATED_TIME,</if>
<if test="updatedBy != null">UPDATED_BY,</if>
@ -83,10 +90,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="billType != null">bill_type,</if>
<if test="checkType != null">check_type,</if>
<if test="checkStatus != null">check_status,</if>
<if test="companyId != null">company_id,</if>
<if test="companyName != null">company_name,</if>
<if test="organizeName != null">organize_name,</if>
<if test="oragnizeId != null">oragnize_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if>
<if test="REVISION != null">#{REVISION},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
@ -98,6 +109,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="billType != null">#{billType},</if>
<if test="checkType != null">#{checkType},</if>
<if test="checkStatus != null">#{checkStatus},</if>
<if test="companyId != null">#{companyId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="organizeName != null">#{organizeName},</if>
<if test="oragnizeId != null">#{oragnizeId},</if>
</trim>
</insert>
@ -105,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update dc_busi_param_bill_master
<trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">TENANT_ID = #{tenantId},</if>
<if test="REVISION != null">REVISION = #{REVISION},</if>
<if test="revision != null">REVISION = #{revision},</if>
<if test="createdBy != null">CREATED_BY = #{createdBy},</if>
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
<if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
@ -144,9 +159,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<insert id="batchDcBusiParamBillSubDao">
insert into dc_busi_param_bill_sub( TENANT_ID, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DELETE_BY, DELETE_TIME, id, bill_no, asset_code, field_type, param_code, param_value,count_date,count_hour) values
insert into dc_busi_param_bill_sub( TENANT_ID, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DELETE_BY, DELETE_TIME, id, bill_no, asset_code,asset_name, field_code, field_name, param_code, param_value,count_date,count_hour) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.tenantId}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.deleteBy}, #{item.deleteTime}, #{item.id}, #{item.billNo}, #{item.assetCode}, #{item.fieldType}, #{item.paramCode}, #{item.paramValue}, #{item.countDate}, #{item.countHour})
( #{item.tenantId}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.deleteBy}, #{item.deleteTime}, #{item.id}, #{item.billNo}, #{item.assetCode}, #{item.assetName}, #{item.fieldCode}, #{item.fieldName},#{item.paramCode}, #{item.paramValue}, #{item.countDate}, #{item.countHour})
</foreach>
</insert>
</mapper>

184
lzbi-module/src/main/resources/mapper/draft/DcBusiBillModelMasterMapper.xml

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzbi.draft.mapper.DcBusiBillModelMasterMapper">
<resultMap type="com.lzbi.draft.domain.DcBusiBillModelMaster" id="DcBusiBillModelMasterResult">
<result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="deptId" column="dept_id" />
<result property="roleId" column="role_id" />
<result property="billModelNo" column="bill_model_no" />
<result property="billModelName" column="bill_model_name" />
<result property="fieldCode" column="field_code" />
<result property="companyName" column="company_name" />
<result property="companyId" column="company_id" />
<result property="billModelPoint" column="bill_model_point" />
<result property="orgName" column="org_name" />
<result property="orgId" column="org_id" />
<result property="id" column="id" />
<result property="dataState" column="data_state" />
<result property="useState" column="use_state" />
<result property="fieldName" column="field_name" />
</resultMap>
<resultMap id="DcBusiBillModelMasterDcBusiBillModelSubResult" type="DcBusiBillModelMaster" extends="DcBusiBillModelMasterResult">
<collection property="dcBusiBillModelSubList" notNullColumn="sub_id" javaType="java.util.List" resultMap="DcBusiBillModelSubResult" />
</resultMap>
<resultMap type="DcBusiBillModelSub" id="DcBusiBillModelSubResult">
<result property="billModelNo" column="sub_bill_model_no" />
<result property="assetCode" column="sub_asset_code" />
<result property="assetName" column="sub_asset_name" />
<result property="assetUnitCode" column="sub_asset_unit_code" />
<result property="assetUnitName" column="sub_asset_unit_name" />
<result property="assetUnitType" column="sub_asset_unit_type" />
<result property="id" column="sub_id" />
<result property="assetId" column="sub_asset_id" />
</resultMap>
<sql id="selectDcBusiBillModelMasterVo">
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, dept_id, role_id, bill_model_no, bill_model_name, field_code, company_name, company_id, bill_model_point, org_name, org_id, id, data_state, use_state, field_name from dc_busi_bill_model_master
</sql>
<select id="selectDcBusiBillModelMasterList" parameterType="DcBusiBillModelMaster" resultMap="DcBusiBillModelMasterResult">
<include refid="selectDcBusiBillModelMasterVo"/>
<where>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
<if test="roleId != null "> and role_id = #{roleId}</if>
<if test="billModelNo != null and billModelNo != ''"> and bill_model_no = #{billModelNo}</if>
<if test="billModelName != null and billModelName != ''"> and bill_model_name like concat('%', #{billModelName}, '%')</if>
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="billModelPoint != null and billModelPoint != ''"> and bill_model_point = #{billModelPoint}</if>
<if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
<if test="dataState != null and dataState != ''"> and data_state = #{dataState}</if>
<if test="useState != null and useState != ''"> and use_state = #{useState}</if>
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
</where>
</select>
<select id="selectDcBusiBillModelMasterById" parameterType="Long" resultMap="DcBusiBillModelMasterDcBusiBillModelSubResult">
select a.tenant_id, a.revision, a.created_by, a.created_time, a.updated_by, a.updated_time, a.delete_by, a.delete_time, a.dept_id, a.role_id, a.bill_model_no, a.bill_model_name, a.field_code, a.company_name, a.company_id, a.bill_model_point, a.org_name, a.org_id, a.id, a.data_state, a.use_state, a.field_name,
b.bill_model_no as sub_bill_model_no, b.asset_code as sub_asset_code, b.asset_name as sub_asset_name, b.asset_unit_code as sub_asset_unit_code, b.asset_unit_name as sub_asset_unit_name, b.asset_unit_type as sub_asset_unit_type, b.id as sub_id, b.asset_id as sub_asset_id
from dc_busi_bill_model_master a
left join dc_busi_bill_model_sub b on b.bill_model_no = a.id
where a.id = #{id}
</select>
<insert id="insertDcBusiBillModelMaster" parameterType="DcBusiBillModelMaster" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_bill_model_master
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</if>
<if test="deptId != null">dept_id,</if>
<if test="roleId != null">role_id,</if>
<if test="billModelNo != null">bill_model_no,</if>
<if test="billModelName != null">bill_model_name,</if>
<if test="fieldCode != null">field_code,</if>
<if test="companyName != null">company_name,</if>
<if test="companyId != null">company_id,</if>
<if test="billModelPoint != null">bill_model_point,</if>
<if test="orgName != null">org_name,</if>
<if test="orgId != null">org_id,</if>
<if test="dataState != null">data_state,</if>
<if test="useState != null">use_state,</if>
<if test="fieldName != null">field_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</if>
<if test="deptId != null">#{deptId},</if>
<if test="roleId != null">#{roleId},</if>
<if test="billModelNo != null">#{billModelNo},</if>
<if test="billModelName != null">#{billModelName},</if>
<if test="fieldCode != null">#{fieldCode},</if>
<if test="companyName != null">#{companyName},</if>
<if test="companyId != null">#{companyId},</if>
<if test="billModelPoint != null">#{billModelPoint},</if>
<if test="orgName != null">#{orgName},</if>
<if test="orgId != null">#{orgId},</if>
<if test="dataState != null">#{dataState},</if>
<if test="useState != null">#{useState},</if>
<if test="fieldName != null">#{fieldName},</if>
</trim>
</insert>
<update id="updateDcBusiBillModelMaster" parameterType="DcBusiBillModelMaster">
update dc_busi_bill_model_master
<trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="deleteBy != null">delete_by = #{deleteBy},</if>
<if test="deleteTime != null">delete_time = #{deleteTime},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="roleId != null">role_id = #{roleId},</if>
<if test="billModelNo != null">bill_model_no = #{billModelNo},</if>
<if test="billModelName != null">bill_model_name = #{billModelName},</if>
<if test="fieldCode != null">field_code = #{fieldCode},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="companyId != null">company_id = #{companyId},</if>
<if test="billModelPoint != null">bill_model_point = #{billModelPoint},</if>
<if test="orgName != null">org_name = #{orgName},</if>
<if test="orgId != null">org_id = #{orgId},</if>
<if test="dataState != null">data_state = #{dataState},</if>
<if test="useState != null">use_state = #{useState},</if>
<if test="fieldName != null">field_name = #{fieldName},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcBusiBillModelMasterById" parameterType="Long">
delete from dc_busi_bill_model_master where id = #{id}
</delete>
<delete id="deleteDcBusiBillModelMasterByIds" parameterType="String">
delete from dc_busi_bill_model_master where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteDcBusiBillModelSubByBillModelNos" parameterType="String">
delete from dc_busi_bill_model_sub where bill_model_no in
<foreach item="billModelNo" collection="array" open="(" separator="," close=")">
#{billModelNo}
</foreach>
</delete>
<delete id="deleteDcBusiBillModelSubByBillModelNo" parameterType="Long">
delete from dc_busi_bill_model_sub where bill_model_no = #{billModelNo}
</delete>
<insert id="batchDcBusiBillModelSub">
insert into dc_busi_bill_model_sub( bill_model_no, asset_code, asset_name, asset_unit_code, asset_unit_name, asset_unit_type, id, asset_id) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.billModelNo}, #{item.assetCode}, #{item.assetName}, #{item.assetUnitCode}, #{item.assetUnitName}, #{item.assetUnitType}, #{item.id}, #{item.assetId})
</foreach>
</insert>
</mapper>

11
lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml

@ -27,10 +27,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="targetFieldName" column="target_field_name" />
<result property="fieldUnit" column="field_unit" />
<result property="columnType" column="column_type" />
</resultMap>
<sql id="selectDcBaseAssetTargetVo">
select id, asset_id,asset_code, target_model_code, target_name, target_code, target_field, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, sort, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_base_asset_target
select id, asset_id,asset_code, target_model_code, target_name, target_code, target_field, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, sort, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time,target_field_name
value_type,
field_unit
from dc_base_asset_target
</sql>
<select id="selectDcBaseAssetTargetDaoList" parameterType="DcBaseAssetTargetDao" resultMap="DcBaseAssetTargetResult">
@ -42,10 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if>
<if test="targetField != null and targetField != ''"> and target_field = #{targetField}</if>
<if test="assetCode != null "> and asset_code = #{assetCode}</if>
<if test="columnType != null and columnType != ''"> and column_type = #{columnType}</if>
</where>
</select>
<select id="selectDcBaseAssetTargetDaoById" parameterType="Long" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/>
where id = #{id}

3
lzbi-system/src/main/java/com/lzbi/system/mapper/SysDeptMapper.java

@ -1,5 +1,6 @@
package com.lzbi.system.mapper;
import java.util.HashMap;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.lzbi.common.core.domain.entity.SysDept;
@ -118,4 +119,6 @@ public interface SysDeptMapper
//add by zhousq 2023-12 根据部门类别筛选部门
public List<SysDept> selectOrg(Long parentId);
public List<SysDept> selectCompany(Long parentId);
public HashMap<Long,String> selectDeptMap();
}

2
lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java

@ -1,5 +1,6 @@
package com.lzbi.system.service;
import java.util.HashMap;
import java.util.List;
import com.lzbi.common.core.domain.TreeSelect;
import com.lzbi.common.core.domain.entity.SysDept;
@ -124,5 +125,6 @@ public interface ISysDeptService
public List<SysDept> selectOrg(Long parentId);
public List<SysDept> selectCompany(Long parentId);
public HashMap<Long,String> selectDeptMap();
}

6
lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java

@ -1,6 +1,7 @@
package com.lzbi.system.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
@ -313,6 +314,11 @@ public class SysDeptServiceImpl implements ISysDeptService {
public List<SysDept> selectCompany(Long parentId){
return deptMapper.selectCompany(parentId);
}
@Override
//获取所有部门的hash映射,便于查询(key :depid,value:deptName)
public HashMap selectDeptMap(){
return deptMapper.selectDeptMap();
}
/**
* 递归列表
*/

5
lzbi-system/src/main/resources/mapper/system/SysDeptMapper.xml

@ -77,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="parentId != null "> and d.parent_id = #{parentId}</if>
</where>
</select>
<select id="selectOrg" parameterType="long" resultMap="SysDeptResult">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,d.short_name,d.all_name,d.org_type,
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
@ -86,6 +87,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="parentId != null "> and d.parent_id = #{parentId}</if>
</where>
</select>
<select id="selectDeptMap" resultType="map">
select d.dept_id,d.dept_name from sys_dept d
</select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
</select>

Loading…
Cancel
Save