Browse Source

Merge branch 'develop' of https://gitee.com/lmlz_0/manage into develop

develop
bobol 12 months ago
parent
commit
c2118aa109
  1. 2
      lzbi-admin/src/main/resources/application-dev.yml
  2. 70
      lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseAssetInfoController.java
  3. 4
      lzbi-module/src/main/java/com/lzbi/asset/controller/DcBusiWorkReadConfigController.java
  4. 225
      lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java
  5. 17
      lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java
  6. 100
      lzbi-module/src/main/java/com/lzbi/asset/service/DcBaseAssetInfoService.java
  7. 3
      lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java
  8. 5
      lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java
  9. 12
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java
  10. 20
      lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java
  11. 131
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiBillModelMasterController.java
  12. 182
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java
  13. 87
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelMaster.java
  14. 53
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelSub.java
  15. 31
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillMaster.java
  16. 12
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java
  17. 89
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiBillModelMasterMapper.java
  18. 130
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiBillModelMasterService.java
  19. 33
      lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java
  20. 2
      lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java
  21. 8
      lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java
  22. 13
      lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java
  23. 1
      lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java
  24. 4
      lzbi-module/src/main/java/com/lzbi/task/TaskParamDfratProcess.java
  25. 4
      lzbi-module/src/main/java/com/lzbi/task/TaskWorkParamRead.java
  26. 6
      lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml
  27. 3
      lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml
  28. 31
      lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml
  29. 184
      lzbi-module/src/main/resources/mapper/draft/DcBusiBillModelMasterMapper.xml
  30. 51
      lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml
  31. 3
      lzbi-system/src/main/java/com/lzbi/system/mapper/SysDeptMapper.java
  32. 2
      lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java
  33. 6
      lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java
  34. 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 # 端口,默认为6379
port: 7000 port: 7000
# 数据库索引 # 数据库索引
database: 15 database: 14
# 密码 # 密码
password: redis123 password: redis123
# 连接超时时间 # 连接超时时间

70
lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseAssetInfoController.java

@ -2,8 +2,12 @@ package com.lzbi.asset.controller;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.lzbi.asset.domain.DcBaseAssetInfo; import com.lzbi.asset.domain.DcBaseAssetInfo;
import com.lzbi.asset.service.IDcBaseAssetInfoService; import com.lzbi.asset.service.DcBaseAssetInfoService;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.common.utils.poi.ExcelUtil; import com.lzbi.common.utils.poi.ExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -21,6 +25,7 @@ import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.enums.BusinessType; import com.lzbi.common.enums.BusinessType;
import com.lzbi.common.core.page.TableDataInfo; import com.lzbi.common.core.page.TableDataInfo;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -33,7 +38,7 @@ import java.util.List;
@RequestMapping("/lzbi/assetInfo") @RequestMapping("/lzbi/assetInfo")
public class DcBaseAssetInfoController extends BaseController { public class DcBaseAssetInfoController extends BaseController {
@Autowired @Autowired
private IDcBaseAssetInfoService dcBaseAssetInfoService; private DcBaseAssetInfoService dcBaseAssetInfoService;
/** /**
* 查询资产信息列表 * 查询资产信息列表
@ -96,4 +101,65 @@ public class DcBaseAssetInfoController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(dcBaseAssetInfoService.deleteDcBaseAssetInfoByIds(ids)); return toAjax(dcBaseAssetInfoService.deleteDcBaseAssetInfoByIds(ids));
} }
/**
* 新增资产信息
*/
@PreAuthorize("@ss.hasPermi('lzbi:assetInfo:add')")
@Log(title = "资产信息", businessType = BusinessType.INSERT)
@PostMapping("/addBatch")
public AjaxResult addBatch(@RequestBody JSONArray jsonArray)
{
if (jsonArray == null) {
throw new IllegalArgumentException("未能接收任何参数!");
}
List<DcBaseAssetInfo> beanList = new ArrayList<>();
try {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject beanObject = jsonArray.getJSONObject(i);
// 移除ID属性
beanObject.remove("id");
DcBaseAssetInfo dcBaseAssetInfo = JSON.toJavaObject(beanObject, DcBaseAssetInfo.class);
dcBaseAssetInfo.setCreatedTime(DateUtils.getNowDate());
dcBaseAssetInfo.setDeptId(getDeptId());
dcBaseAssetInfo.setUserId(getUserId());
dcBaseAssetInfo.setCreatedBy(String.valueOf(getUserId()));
dcBaseAssetInfo.setCreatedTime(DateUtils.getNowDate());
beanList.add(dcBaseAssetInfo);
}
} catch (Exception e) {
throw new IllegalArgumentException("解析list对象异常!");
}
return toAjax(dcBaseAssetInfoService.saveBatch(beanList));
}
/**
* 修改资产信息
*/
@PreAuthorize("@ss.hasPermi('lzbi:assetInfo:edit')")
@Log(title = "资产信息", businessType = BusinessType.UPDATE)
@PutMapping("/editBatch")
public AjaxResult editBatch(@RequestBody JSONArray jsonArray)
{
if (jsonArray == null) {
throw new IllegalArgumentException("未能接收任何参数!");
}
List<DcBaseAssetInfo> beanList = new ArrayList<>();
try {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject beanObject = jsonArray.getJSONObject(i);
DcBaseAssetInfo dcBaseAssetInfo = JSON.toJavaObject(beanObject, DcBaseAssetInfo.class);
dcBaseAssetInfo.setUpdatedBy(String.valueOf(getUserId()));
dcBaseAssetInfo.setUpdatedTime(DateUtils.getNowDate());
beanList.add(dcBaseAssetInfo);
}
} catch (Exception e) {
throw new IllegalArgumentException("解析list对象异常!");
}
return toAjax(dcBaseAssetInfoService.updateBatchById(beanList));
}
} }

4
lzbi-module/src/main/java/com/lzbi/asset/controller/DcBusiWorkReadConfigController.java

@ -5,8 +5,8 @@ import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.lzbi.asset.domain.DcBusiWorkReadConfig; import com.lzbi.asset.domain.DcBusiWorkReadConfig;
import com.lzbi.asset.service.DcBaseAssetInfoService;
import com.lzbi.asset.service.DcBusiWorkReadConfigService; import com.lzbi.asset.service.DcBusiWorkReadConfigService;
import com.lzbi.asset.service.IDcBaseAssetInfoService;
import com.lzbi.common.AssetQueryParams; import com.lzbi.common.AssetQueryParams;
import com.lzbi.common.annotation.Log; import com.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController; import com.lzbi.common.core.controller.BaseController;
@ -41,7 +41,7 @@ public class DcBusiWorkReadConfigController extends BaseController {
@Autowired @Autowired
private DcBaseWorkSpecialService specialService; private DcBaseWorkSpecialService specialService;
@Autowired @Autowired
private IDcBaseAssetInfoService assetInfoService; private DcBaseAssetInfoService assetInfoService;
/** /**
* 查询互联参数读取数据对照列表 * 查询互联参数读取数据对照列表

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

@ -1,11 +1,10 @@
package com.lzbi.asset.domain; package com.lzbi.asset.domain;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lzbi.common.annotation.Excel; import com.lzbi.common.annotation.Excel;
import com.lzbi.common.core.domain.BaseEntity; import com.lzbi.module.base.BaseModuleEntity;
import lombok.Data;
import lombok.experimental.Accessors;
/** /**
* 资产信息对象 dc_base_asset_info * 资产信息对象 dc_base_asset_info
@ -13,54 +12,12 @@ import com.lzbi.common.core.domain.BaseEntity;
* @author Lu.JL * @author Lu.JL
* @date 2023-11-27 * @date 2023-11-27
*/ */
public class DcBaseAssetInfo extends BaseEntity { @Data
//@TableName("dc_base_work_special")
@Accessors(chain = true)
public class DcBaseAssetInfo extends BaseModuleEntity {
private static final long serialVersionUID = 1L; 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;
/**
* 资产ID
*/
private Long id;
/** /**
* 资产名称 * 资产名称
*/ */
@ -114,172 +71,12 @@ public class DcBaseAssetInfo extends BaseEntity {
*/ */
@Excel(name = "所属组织结构") @Excel(name = "所属组织结构")
private Long deptId; private Long deptId;
public String getValue() {
public void setTenantId(String tenantId) { return this.assetCode;
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 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 getLabel() {
public String toString() { return this.assetName;
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();
} }
} }

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

@ -1,17 +1,22 @@
package com.lzbi.asset.mapper; package com.lzbi.asset.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.asset.domain.DcBaseAssetInfo; import com.lzbi.asset.domain.DcBaseAssetInfo;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
* 资产信息Mapper接口 * 资产信息Mapper接口
* *
* @author Lu.JL * @author Lu.JL
* @date 2023-11-27 * @date 2023-12-10
*/ */
public interface DcBaseAssetInfoMapper {
@Service
public interface DcBaseAssetInfoMapper extends BaseMapper<DcBaseAssetInfo>
{
/** /**
* 查询资产信息 * 查询资产信息
* *
@ -20,6 +25,8 @@ public interface DcBaseAssetInfoMapper {
*/ */
public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id); public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id);
public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetcode); public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetcode);
public HashMap<String,String> selectDcBaseAssetInfoMap();
/** /**
* 查询资产信息列表 * 查询资产信息列表
* *
@ -59,4 +66,8 @@ public interface DcBaseAssetInfoMapper {
* @return 结果 * @return 结果
*/ */
public int deleteDcBaseAssetInfoByIds(Long[] ids); public int deleteDcBaseAssetInfoByIds(Long[] ids);
} }

100
lzbi-module/src/main/java/com/lzbi/asset/service/DcBaseAssetInfoService.java

@ -0,0 +1,100 @@
package com.lzbi.asset.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lzbi.asset.domain.DcBaseAssetInfo;
import com.lzbi.asset.mapper.DcBaseAssetInfoMapper;
import com.lzbi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 资产信息Service业务层处理
*
* @author Lu.JL
* @date 2023-12-10
*/
@Service
public class DcBaseAssetInfoService extends ServiceImpl<DcBaseAssetInfoMapper, DcBaseAssetInfo> implements IService<DcBaseAssetInfo>
{
/**
* 查询资产信息
*
* @param id 资产信息主键
* @return 资产信息
*/
public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id)
{
return baseMapper.selectDcBaseAssetInfoById(id);
}
/**
* 查询资产信息列表
*
* @param dcBaseAssetInfo 资产信息
* @return 资产信息
*/
public List<DcBaseAssetInfo> selectDcBaseAssetInfoList(DcBaseAssetInfo dcBaseAssetInfo)
{
return baseMapper.selectDcBaseAssetInfoList(dcBaseAssetInfo);
}
/**
* 新增资产信息
*
* @param dcBaseAssetInfo 资产信息
* @return 结果
*/
public int insertDcBaseAssetInfo(DcBaseAssetInfo dcBaseAssetInfo)
{
dcBaseAssetInfo.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBaseAssetInfo(dcBaseAssetInfo);
}
/**
* 修改资产信息
*
* @param dcBaseAssetInfo 资产信息
* @return 结果
*/
public int updateDcBaseAssetInfo(DcBaseAssetInfo dcBaseAssetInfo)
{
dcBaseAssetInfo.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBaseAssetInfo(dcBaseAssetInfo);
}
/**
* 批量删除资产信息
*
* @param ids 需要删除的资产信息主键
* @return 结果
*/
public int deleteDcBaseAssetInfoByIds(Long[] ids)
{
return baseMapper.deleteDcBaseAssetInfoByIds(ids);
}
/**
* 删除资产信息信息
*
* @param id 资产信息主键
* @return 结果
*/
public int deleteDcBaseAssetInfoById(Long id)
{
return baseMapper.deleteDcBaseAssetInfoById(id);
}
public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode) {
return baseMapper.selectDcBaseAssetInfoByCode(assetCode);
}
}

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 com.lzbi.asset.domain.DcBaseAssetInfo;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -20,6 +21,8 @@ public interface IDcBaseAssetInfoService {
*/ */
public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id); public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id);
public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode); 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; package com.lzbi.asset.service.impl;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.lzbi.asset.domain.DcBaseAssetInfo; import com.lzbi.asset.domain.DcBaseAssetInfo;
@ -33,6 +34,10 @@ public class DcBaseAssetInfoServiceImpl implements IDcBaseAssetInfoService {
public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode) { public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode) {
return dcBaseAssetInfoMapper.selectDcBaseAssetInfoByCode(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") @GetMapping("/coalLostRate")
public AjaxResult getCoalLostRate() 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); List<DcBusiDataScreenVo> maps = dcBusiDataScreenMainService.selectCoalLostByDate(qdate);
JSONArray product=new JSONArray(); JSONArray product=new JSONArray();
JSONArray realcost=new JSONArray(); JSONArray realcost=new JSONArray();
@ -81,7 +81,7 @@ public class DcBusiDataScreenMainController extends BaseController{
@GetMapping("/powerInfoAll") @GetMapping("/powerInfoAll")
public AjaxResult getPowerInfoAll() 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); List<DcBusiDataScreenVo> maps = dcBusiDataScreenMainService.selectPowerAll(qdate);
JSONArray list=new JSONArray(); JSONArray list=new JSONArray();
AtomicReference<String> unit = new AtomicReference<>(); AtomicReference<String> unit = new AtomicReference<>();
@ -103,7 +103,7 @@ public class DcBusiDataScreenMainController extends BaseController{
@GetMapping("/squareInfoCompany") @GetMapping("/squareInfoCompany")
public AjaxResult getSquareInfoCompany() 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> real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate);
List<DcBusiDataScreenVo> self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate); List<DcBusiDataScreenVo> self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate);
List<DcBusiDataScreenVo> group = dcBusiDataScreenMainService.selectSquareGroup(qdate); List<DcBusiDataScreenVo> group = dcBusiDataScreenMainService.selectSquareGroup(qdate);
@ -144,7 +144,7 @@ public class DcBusiDataScreenMainController extends BaseController{
@GetMapping("/squareInfoGroup") @GetMapping("/squareInfoGroup")
public AjaxResult getSquareInfoGroup() 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> real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate);
List<DcBusiDataScreenVo> self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate); List<DcBusiDataScreenVo> self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate);
List<DcBusiDataScreenVo> group = dcBusiDataScreenMainService.selectSquareGroup(qdate); List<DcBusiDataScreenVo> group = dcBusiDataScreenMainService.selectSquareGroup(qdate);
@ -221,7 +221,7 @@ public class DcBusiDataScreenMainController extends BaseController{
* */ * */
@GetMapping("/powerLostRate") @GetMapping("/powerLostRate")
public AjaxResult getPowerLostRate(){ 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); List<DcBusiDataScreenVo> data = dcBusiDataScreenMainService.selectDataPowerLost(qdate);
JSONArray product=new JSONArray(); JSONArray product=new JSONArray();
JSONArray realcost=new JSONArray(); JSONArray realcost=new JSONArray();
@ -246,7 +246,7 @@ public class DcBusiDataScreenMainController extends BaseController{
* */ * */
@GetMapping("/waterInfo") @GetMapping("/waterInfo")
public AjaxResult getWaterInfo(){ 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_1 = dcBusiDataScreenMainService.selectDataWaterLostFirst(qdate);
List<DcBusiDataScreenVo> data_2 = dcBusiDataScreenMainService.selectDataWaterLostSecond(qdate); List<DcBusiDataScreenVo> data_2 = dcBusiDataScreenMainService.selectDataWaterLostSecond(qdate);
List<DcBusiDataScreenVo> data_3 = dcBusiDataScreenMainService.selectDataWaterLostStationAll(qdate); List<DcBusiDataScreenVo> data_3 = dcBusiDataScreenMainService.selectDataWaterLostStationAll(qdate);

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

@ -2,8 +2,8 @@ package com.lzbi.common;
import com.lzbi.asset.domain.DcBaseAssetInfo; import com.lzbi.asset.domain.DcBaseAssetInfo;
import com.lzbi.asset.domain.DcBusiParamSource; import com.lzbi.asset.domain.DcBusiParamSource;
import com.lzbi.asset.service.DcBaseAssetInfoService;
import com.lzbi.asset.service.DcBusiParamSourceService; import com.lzbi.asset.service.DcBusiParamSourceService;
import com.lzbi.asset.service.IDcBaseAssetInfoService;
import com.lzbi.common.core.controller.BaseController; import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult; import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.core.domain.TreeSelect; import com.lzbi.common.core.domain.TreeSelect;
@ -19,6 +19,7 @@ import org.springframework.lang.Nullable;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Optional;
/** /**
* @auth create by Administrator * @auth create by Administrator
@ -34,7 +35,7 @@ public class SelectOptionsControl extends BaseController {
@Autowired @Autowired
DcBaseWorkSpecialService dcBaseWorkSpecialService; DcBaseWorkSpecialService dcBaseWorkSpecialService;
@Autowired @Autowired
IDcBaseAssetInfoService dcBaseAssetInfoService; DcBaseAssetInfoService dcBaseAssetInfoService;
@Autowired @Autowired
DcBusiParamSourceService dcBusiParamSourceService; DcBusiParamSourceService dcBusiParamSourceService;
@Autowired @Autowired
@ -104,8 +105,8 @@ public class SelectOptionsControl extends BaseController {
{ {
DcBaseAssetInfo dcBaseAssetInfo=new DcBaseAssetInfo(); DcBaseAssetInfo dcBaseAssetInfo=new DcBaseAssetInfo();
//dcBaseAssetInfo.setAssetClass(assetQueryParams.getFieldCode()); //dcBaseAssetInfo.setAssetClass(assetQueryParams.getFieldCode());
dcBaseAssetInfo.setComanyId(assetQueryParams.getCompanyID()); dcBaseAssetInfo.setComanyId(Optional.ofNullable(assetQueryParams.getCompanyID()).orElse(0L));
dcBaseAssetInfo.setDeptId(assetQueryParams.getOrgID()); dcBaseAssetInfo.setDeptId(Optional.ofNullable(assetQueryParams.getOrgID()).orElse(0L));
return AjaxResult.success(dcBaseAssetInfoService.selectDcBaseAssetInfoList(dcBaseAssetInfo)); return AjaxResult.success(dcBaseAssetInfoService.selectDcBaseAssetInfoList(dcBaseAssetInfo));
} }
//根据条件获取统计单元指标列表 //根据条件获取统计单元指标列表
@ -115,6 +116,17 @@ public class SelectOptionsControl extends BaseController {
{ {
DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao(); DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao();
dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode()); 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()); //dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId());
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao)); 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; 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.annotation.Log;
import com.lzbi.common.core.controller.BaseController; import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult; 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.core.page.TableDataInfo;
import com.lzbi.common.enums.BusinessType; 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.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.DcBusiParamBillMaster;
import com.lzbi.draft.domain.DcBusiParamBillSub;
import com.lzbi.draft.service.DcBusiBillModelMasterService;
import com.lzbi.draft.service.DcBusiParamBillMasterService; 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.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
/** /**
* 参数采集录入单据主Controller * 参数采集录入单据主Controller
@ -25,20 +44,177 @@ import java.util.List;
@RequestMapping("/draft/paramCollect") @RequestMapping("/draft/paramCollect")
public class DcBusiParamCollectBill extends BaseController public class DcBusiParamCollectBill extends BaseController
{ {
@Autowired
private DcBusiBillModelMasterService dcBusiBillModelMasterService;
@Autowired @Autowired
private DcBusiParamBillMasterService dcBusiParamBillMasterService; 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") @GetMapping("/list")
public TableDataInfo list(DcBusiParamBillMaster dcBusiParamBillMasterDao) public TableDataInfo list(DcBusiParamBillMaster dcBusiParamBillMasterDao)
{ {
startPage(); 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); 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);
}
} }

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

@ -0,0 +1,87 @@
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 lombok.experimental.Accessors;
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
@Accessors(chain = true)
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;
}

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

@ -0,0 +1,53 @@
package com.lzbi.draft.domain;
import lombok.Data;
import lombok.experimental.Accessors;
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
*/
@Data
@Accessors(chain = true)
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;
}

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

@ -1,5 +1,6 @@
package com.lzbi.draft.domain; package com.lzbi.draft.domain;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -49,7 +50,7 @@ public class DcBusiParamBillMaster extends BaseModuleEntity
private String checkStatus ; private String checkStatus ;
/** 公司ID */ /** 公司ID */
@ApiModelProperty(name = "公司ID",notes = "") @ApiModelProperty(name = "公司ID",notes = "")
private Integer companyId ; private Long companyId ;
/** 公司名称 */ /** 公司名称 */
@ApiModelProperty(name = "公司名称",notes = "") @ApiModelProperty(name = "公司名称",notes = "")
private String companyName ; private String companyName ;
@ -58,17 +59,27 @@ public class DcBusiParamBillMaster extends BaseModuleEntity
private String organizeName ; private String organizeName ;
/** 组织机构ID */ /** 组织机构ID */
@ApiModelProperty(name = "组织机构ID",notes = "") @ApiModelProperty(name = "组织机构ID",notes = "")
private Integer oragnizeId ; private Long oragnizeId ;
/** 统计单元编码 */ /** 统计单元编码 --不在主单据中了*/
@ApiModelProperty(name = "统计单元编码",notes = "") // @ApiModelProperty(name = "统计单元编码",notes = "")
private String assetCode ; // private String assetCode ;
/** 统计单元名称 */ // /** 统计单元名称 */
@ApiModelProperty(name = "统计单元名称",notes = "") // @ApiModelProperty(name = "统计单元名称",notes = "")
private String assetName ; // 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; 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 = "") @ApiModelProperty(name = "统计单元名称",notes = "")
private String assetName ; private String assetName ;
/** 所属专业 */ /** 所属专业 */
@ApiModelProperty(name = "所属专业",notes = "") @ApiModelProperty(name = "所属专业编码",notes = "")
private String fieldType ; private String fieldCode ;
/** 所属专业 */
@ApiModelProperty(name = "所属专业名称",notes = "")
private String fieldName ;
/** 指标名称 */ /** 指标名称 */
@ApiModelProperty(name = "指标名称",notes = "") @ApiModelProperty(name = "指标名称",notes = "")
private String paramName ; private String paramName ;
@ -60,6 +63,7 @@ public class DcBusiParamBillSub extends BaseModuleEntity{
private String countDate ; private String countDate ;
@ApiModelProperty(name = "统计小时",notes = "24小时") @ApiModelProperty(name = "统计小时",notes = "24小时")
private Integer countHour ; private Integer countHour ;
public String getAssetCode(){ public String getAssetCode(){
return Optional.ofNullable(this.assetCode).orElse(""); return Optional.ofNullable(this.assetCode).orElse("");
} }
@ -69,7 +73,7 @@ public class DcBusiParamBillSub extends BaseModuleEntity{
public String getCountDate(){ public String getCountDate(){
return Optional.ofNullable(this.countDate).orElse(""); return Optional.ofNullable(this.countDate).orElse("");
} }
public String getFieldType(){ public String getFieldCode(){
return Optional.ofNullable(this.fieldType).orElse(""); 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);
}
}
}
}

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

@ -4,7 +4,11 @@ import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; 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.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -18,35 +22,14 @@ import com.lzbi.module.base.BaseModuleEntity;
* @date 2023-11-28 * @date 2023-11-28
*/ */
@Data @Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "参数数据采集(录入)明细表",description = "")
@TableName("dc_base_work_special")
public class DcBaseWorkSpecial extends BaseModuleEntity public class DcBaseWorkSpecial extends BaseModuleEntity
{ {
private static final long serialVersionUID = 1L; 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) @TableId(value = "id", type = IdType.AUTO)
/** 主键 */ /** 主键 */
private Long id; private Long id;

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

@ -1,5 +1,6 @@
package com.lzbi.special.mapper; package com.lzbi.special.mapper;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -63,4 +64,5 @@ public interface DcBaseWorkSpecialMapper extends BaseMapper<DcBaseWorkSpecial>
* @return 结果 * @return 结果
*/ */
public int deleteDcBaseWorkSpecialByIds(Long[] ids); 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; package com.lzbi.special.service;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.lzbi.common.utils.DateUtils; import com.lzbi.common.utils.DateUtils;
@ -99,4 +100,11 @@ public class DcBaseWorkSpecialService extends ServiceImpl<DcBaseWorkSpecialMappe
{ {
return baseMapper.deleteDcBaseWorkSpecialById(id); 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.math.BigDecimal;
import java.util.Date; 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 lombok.Data;
import com.lzbi.common.annotation.Excel; import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity; import com.lzbi.module.base.BaseModuleEntity;
@ -18,7 +22,7 @@ import lombok.experimental.Accessors;
public class DcBaseAssetTargetDao extends BaseModuleEntity public class DcBaseAssetTargetDao extends BaseModuleEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
/** 主键 */ /** 主键 */
private Long id; private Long id;
@ -76,6 +80,13 @@ public class DcBaseAssetTargetDao extends BaseModuleEntity
/** 统计单元编码 */ /** 统计单元编码 */
@Excel(name = "统计单元编码") @Excel(name = "统计单元编码")
private String assetCode; 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 value;
private String label; private String label;

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

@ -40,6 +40,7 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
*/ */
public List<DcBaseAssetTargetDao> selectDcBaseAssetTargetDaoList(DcBaseAssetTargetDao 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(); DcBusiParamBillSub billSub=new DcBusiParamBillSub();
billSub.setBillNo(billMasterDao.getBillNo()); billSub.setBillNo(billMasterDao.getBillNo());
List<DcBusiParamBillSub> dcBusiParamBillSubs = dcBusiParamBillSubService.selectByVo(billSub); 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)->{ collect.forEach((key,value)->{
String[] s=key.split(":"); String[] s=key.split(":");
ParamDraftQueryVo queryVo=new ParamDraftQueryVo(); ParamDraftQueryVo queryVo=new ParamDraftQueryVo();
@ -50,7 +50,7 @@ public class TaskParamDfratProcess {
if(StringUtils.isNull(dcBusiParamDraftDay.getId())){ if(StringUtils.isNull(dcBusiParamDraftDay.getId())){
dcBusiParamDraftDay.setCreatedTime(DateUtil.date()); dcBusiParamDraftDay.setCreatedTime(DateUtil.date());
dcBusiParamDraftDay.setCreatedBy("task"); dcBusiParamDraftDay.setCreatedBy("task");
dcBusiParamDraftDay.setParamFieldCode(val.getFieldType()); dcBusiParamDraftDay.setParamFieldCode(val.getFieldCode());
dcBusiParamDraftDay.setParamCode(val.getParamCode()); dcBusiParamDraftDay.setParamCode(val.getParamCode());
dcBusiParamDraftDay.setCountDate(val.getCountDate()); dcBusiParamDraftDay.setCountDate(val.getCountDate());
dcBusiParamDraftDay.setAssetCode(val.getAssetCode()); 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 org.springframework.stereotype.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -118,7 +119,7 @@ public class TaskWorkParamRead {
Double va=item.getValueByType(find.get().getGoalParamType()); Double va=item.getValueByType(find.get().getGoalParamType());
subDao.setParamValue(va); subDao.setParamValue(va);
subDao.setParamCode(find.get().getAssetParamCode()); subDao.setParamCode(find.get().getAssetParamCode());
subDao.setFieldType(find.get().getAssetFieldCode()); subDao.setFieldCode(find.get().getAssetFieldCode());
subDao.setCountDate(item.getDateCount()); subDao.setCountDate(item.getDateCount());
subDao.setCountHour(item.getHourCount()); subDao.setCountHour(item.getHourCount());
billSub.add(subDao); billSub.add(subDao);
@ -127,4 +128,5 @@ public class TaskWorkParamRead {
billm.setDcBusiParamBillSubList(billSub); billm.setDcBusiParamBillSubList(billSub);
return dcBusiParamBillMasterService.insertDcBusiParamBillMasterDao(billm); return dcBusiParamBillMasterService.insertDcBusiParamBillMasterDao(billm);
} }
} }

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

@ -75,6 +75,12 @@
<include refid="selectDcBaseAssetInfoVo"/> <include refid="selectDcBaseAssetInfoVo"/>
where asset_code = #{assetCode} where asset_code = #{assetCode}
</select> </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 id="insertDcBaseAssetInfo" parameterType="DcBaseAssetInfo" useGeneratedKeys="true" keyProperty="id">
insert into dc_base_asset_info insert into dc_base_asset_info
<trim prefix="(" suffix=")" suffixOverrides=","> <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} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="getDcBaseWorkSpecialMap" resultType="hashmap">
select special_code, special_name from dc_base_work_special
</select>
</mapper> </mapper>

31
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="billType" column="bill_type" />
<result property="checkType" column="check_type" /> <result property="checkType" column="check_type" />
<result property="checkStatus" column="check_status" /> <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>
<resultMap id="DcBusiParamBillMasterDcBusiParamBillSubResult" type="DcBusiParamBillMaster" extends="DcBusiParamBillMasterResult"> <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="id" column="sub_id" />
<result property="billNo" column="sub_bill_no" /> <result property="billNo" column="sub_bill_no" />
<result property="assetCode" column="sub_asset_code" /> <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="countDate" column="sub_count_date" />
<result property="countHour" column="sub_count_hour" /> <result property="countHour" column="sub_count_hour" />
<result property="paramCode" column="sub_param_code" /> <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 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, 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 from dc_busi_param_bill_master a
left join dc_busi_param_bill_sub b on b.bill_no = a.bill_no left join dc_busi_param_bill_sub b on b.bill_no = a.bill_no
where a.id = #{id} where a.id = #{id}
@ -71,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into dc_busi_param_bill_master insert into dc_busi_param_bill_master
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tenantId != null">TENANT_ID,</if> <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="createdBy != null">CREATED_BY,</if>
<if test="createdTime != null">CREATED_TIME,</if> <if test="createdTime != null">CREATED_TIME,</if>
<if test="updatedBy != null">UPDATED_BY,</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="billType != null">bill_type,</if>
<if test="checkType != null">check_type,</if> <if test="checkType != null">check_type,</if>
<if test="checkStatus != null">check_status,</if> <if test="checkStatus != null">check_status,</if>
</trim> <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=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if> <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="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if> <if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</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="billType != null">#{billType},</if>
<if test="checkType != null">#{checkType},</if> <if test="checkType != null">#{checkType},</if>
<if test="checkStatus != null">#{checkStatus},</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> </trim>
</insert> </insert>
@ -105,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update dc_busi_param_bill_master update dc_busi_param_bill_master
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">TENANT_ID = #{tenantId},</if> <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="createdBy != null">CREATED_BY = #{createdBy},</if>
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if> <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
<if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if> <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
@ -144,9 +159,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<insert id="batchDcBusiParamBillSubDao"> <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=","> <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> </foreach>
</insert> </insert>
</mapper> </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>

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

@ -1,17 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper"> <mapper namespace="com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper">
<resultMap type="com.lzbi.targetFolder.domain.DcBaseAssetTargetDao" id="DcBaseAssetTargetResult"> <resultMap type="com.lzbi.targetFolder.domain.DcBaseAssetTargetDao" id="DcBaseAssetTargetResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="assetCode" column="asset_code" />
<result property="assetId" column="asset_id" /> <result property="assetId" column="asset_id" />
<result property="assetCode" column="asset_code" /> <result property="assetCode" column="asset_code" />
<result property="targetModelCode" column="target_model_code" /> <result property="targetModelCode" column="target_model_code" />
<result property="targetName" column="target_name" /> <result property="targetName" column="target_name" />
<result property="targetNameAlias" column="target_name_alias" />
<result property="targetCode" column="target_code" /> <result property="targetCode" column="target_code" />
<result property="targetField" column="target_field" /> <result property="targetField" column="target_field" />
<result property="limitUp" column="limit_up" /> <result property="limitUp" column="limit_up" />
@ -20,6 +18,7 @@
<result property="flagAvg" column="flag_avg" /> <result property="flagAvg" column="flag_avg" />
<result property="flagSum" column="flag_sum" /> <result property="flagSum" column="flag_sum" />
<result property="flagCompute" column="flag_compute" /> <result property="flagCompute" column="flag_compute" />
<result property="sort" column="sort" />
<result property="tenantId" column="tenant_id" /> <result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" /> <result property="revision" column="revision" />
<result property="createdBy" column="created_by" /> <result property="createdBy" column="created_by" />
@ -28,50 +27,43 @@
<result property="updatedTime" column="updated_time" /> <result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" /> <result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" /> <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> </resultMap>
<sql id="selectDcBaseAssetTargetVo"> <sql id="selectDcBaseAssetTargetVo">
select id, asset_id,asset_code, target_model_code, target_name, target_name_alias, 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> </sql>
<select id="selectDcBaseAssetTargetDaoList" parameterType="DcBaseAssetTargetDao" resultMap="DcBaseAssetTargetResult"> <select id="selectDcBaseAssetTargetDaoList" parameterType="DcBaseAssetTargetDao" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/> <include refid="selectDcBaseAssetTargetVo"/>
<where> <where>
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if>
<if test="assetId != null "> and asset_id = #{assetId}</if> <if test="assetId != null "> and asset_id = #{assetId}</if>
<if test="targetModelCode != null and targetModelCode != ''"> and target_model_code = #{targetModelCode}</if> <if test="targetModelCode != null and targetModelCode != ''"> and target_model_code = #{targetModelCode}</if>
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if> <if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if>
<if test="targetNameAlias != null and targetNameAlias != ''"> and target_name_alias like concat('%', #{targetNameAlias}, '%')</if>
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if> <if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if>
<if test="targetField != null and targetField != ''"> and target_field = #{targetField}</if> <if test="targetField != null and targetField != ''"> and target_field = #{targetField}</if>
<if test="assetCode != null "> and asset_code = #{assetCode}</if> <if test="assetCode != null "> and asset_code = #{assetCode}</if>
<if test="limitUp != null "> and limit_up = #{limitUp}</if> <if test="columnType != null and columnType != ''"> and column_type = #{columnType}</if>
<if test="limitDown != null "> and limit_down = #{limitDown}</if>
<if test="valueBase != null "> and value_base = #{valueBase}</if>
<if test="flagAvg != null and flagAvg != ''"> and flag_avg = #{flagAvg}</if>
<if test="flagSum != null and flagSum != ''"> and flag_sum = #{flagSum}</if>
<if test="flagCompute != null and flagCompute != ''"> and flag_compute = #{flagCompute}</if>
</where> </where>
</select> </select>
<select id="selectDcBaseAssetTargetDaoById" parameterType="Long" resultMap="DcBaseAssetTargetResult"> <select id="selectDcBaseAssetTargetDaoById" parameterType="Long" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/> <include refid="selectDcBaseAssetTargetVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/>
where target_code = #{targetCode} and asset_code = #{assetCode}
</select>
<insert id="insertDcBaseAssetTargetDao" parameterType="DcBaseAssetTargetDao" useGeneratedKeys="true" keyProperty="id"> <insert id="insertDcBaseAssetTargetDao" parameterType="DcBaseAssetTargetDao" useGeneratedKeys="true" keyProperty="id">
insert into dc_base_asset_target insert into dc_base_asset_target
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="assetCode != null">asset_code,</if>
<if test="assetId != null">asset_id,</if> <if test="assetId != null">asset_id,</if>
<if test="targetModelCode != null">target_model_code,</if> <if test="targetModelCode != null">target_model_code,</if>
<if test="targetName != null">target_name,</if> <if test="targetName != null">target_name,</if>
<if test="targetNameAlias != null and targetNameAlias != ''">target_name_alias,</if>
<if test="targetCode != null">target_code,</if> <if test="targetCode != null">target_code,</if>
<if test="targetField != null">target_field,</if> <if test="targetField != null">target_field,</if>
<if test="limitUp != null">limit_up,</if> <if test="limitUp != null">limit_up,</if>
@ -80,6 +72,7 @@
<if test="flagAvg != null">flag_avg,</if> <if test="flagAvg != null">flag_avg,</if>
<if test="flagSum != null">flag_sum,</if> <if test="flagSum != null">flag_sum,</if>
<if test="flagCompute != null">flag_compute,</if> <if test="flagCompute != null">flag_compute,</if>
<if test="sort != null">sort,</if>
<if test="tenantId != null">tenant_id,</if> <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="createdBy != null">created_by,</if>
@ -88,13 +81,11 @@
<if test="updatedTime != null">updated_time,</if> <if test="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if> <if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</if> <if test="deleteTime != null">delete_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="assetCode != null">#{assetCode},</if>
<if test="assetId != null">#{assetId},</if> <if test="assetId != null">#{assetId},</if>
<if test="targetModelCode != null">#{targetModelCode},</if> <if test="targetModelCode != null">#{targetModelCode},</if>
<if test="targetName != null">#{targetName},</if> <if test="targetName != null">#{targetName},</if>
<if test="targetNameAlias != null and targetNameAlias != ''">#{targetNameAlias},</if>
<if test="targetCode != null">#{targetCode},</if> <if test="targetCode != null">#{targetCode},</if>
<if test="targetField != null">#{targetField},</if> <if test="targetField != null">#{targetField},</if>
<if test="limitUp != null">#{limitUp},</if> <if test="limitUp != null">#{limitUp},</if>
@ -103,6 +94,7 @@
<if test="flagAvg != null">#{flagAvg},</if> <if test="flagAvg != null">#{flagAvg},</if>
<if test="flagSum != null">#{flagSum},</if> <if test="flagSum != null">#{flagSum},</if>
<if test="flagCompute != null">#{flagCompute},</if> <if test="flagCompute != null">#{flagCompute},</if>
<if test="sort != null">#{sort},</if>
<if test="tenantId != null">#{tenantId},</if> <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="createdBy != null">#{createdBy},</if>
@ -111,17 +103,15 @@
<if test="updatedTime != null">#{updatedTime},</if> <if test="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if> <if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</if> <if test="deleteTime != null">#{deleteTime},</if>
</trim> </trim>
</insert> </insert>
<update id="updateDcBaseAssetTargetDao" parameterType="DcBaseAssetTargetDao"> <update id="updateDcBaseAssetTargetDao" parameterType="DcBaseAssetTargetDao">
update dc_base_asset_target update dc_base_asset_target
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetId != null">asset_id = #{assetId},</if> <if test="assetId != null">asset_id = #{assetId},</if>
<if test="targetModelCode != null">target_model_code = #{targetModelCode},</if> <if test="targetModelCode != null">target_model_code = #{targetModelCode},</if>
<if test="targetName != null">target_name = #{targetName},</if> <if test="targetName != null">target_name = #{targetName},</if>
<if test="targetNameAlias != null and targetNameAlias != ''">target_name_alias = #{targetNameAlias},</if>
<if test="targetCode != null">target_code = #{targetCode},</if> <if test="targetCode != null">target_code = #{targetCode},</if>
<if test="targetField != null">target_field = #{targetField},</if> <if test="targetField != null">target_field = #{targetField},</if>
<if test="limitUp != null">limit_up = #{limitUp},</if> <if test="limitUp != null">limit_up = #{limitUp},</if>
@ -130,6 +120,7 @@
<if test="flagAvg != null">flag_avg = #{flagAvg},</if> <if test="flagAvg != null">flag_avg = #{flagAvg},</if>
<if test="flagSum != null">flag_sum = #{flagSum},</if> <if test="flagSum != null">flag_sum = #{flagSum},</if>
<if test="flagCompute != null">flag_compute = #{flagCompute},</if> <if test="flagCompute != null">flag_compute = #{flagCompute},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if> <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="createdBy != null">created_by = #{createdBy},</if>
@ -147,7 +138,7 @@
</delete> </delete>
<delete id="deleteDcBaseAssetTargetDaoByIds" parameterType="String"> <delete id="deleteDcBaseAssetTargetDaoByIds" parameterType="String">
delete from dc_base_asset_target where id in delete from dc_base_asset_target where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

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

@ -1,5 +1,6 @@
package com.lzbi.system.mapper; package com.lzbi.system.mapper;
import java.util.HashMap;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.lzbi.common.core.domain.entity.SysDept; import com.lzbi.common.core.domain.entity.SysDept;
@ -118,4 +119,6 @@ public interface SysDeptMapper
//add by zhousq 2023-12 根据部门类别筛选部门 //add by zhousq 2023-12 根据部门类别筛选部门
public List<SysDept> selectOrg(Long parentId); public List<SysDept> selectOrg(Long parentId);
public List<SysDept> selectCompany(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; package com.lzbi.system.service;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.lzbi.common.core.domain.TreeSelect; import com.lzbi.common.core.domain.TreeSelect;
import com.lzbi.common.core.domain.entity.SysDept; import com.lzbi.common.core.domain.entity.SysDept;
@ -124,5 +125,6 @@ public interface ISysDeptService
public List<SysDept> selectOrg(Long parentId); public List<SysDept> selectOrg(Long parentId);
public List<SysDept> selectCompany(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; package com.lzbi.system.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -313,6 +314,11 @@ public class SysDeptServiceImpl implements ISysDeptService {
public List<SysDept> selectCompany(Long parentId){ public List<SysDept> selectCompany(Long parentId){
return deptMapper.selectCompany(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> <if test="parentId != null "> and d.parent_id = #{parentId}</if>
</where> </where>
</select> </select>
<select id="selectOrg" parameterType="long" resultMap="SysDeptResult"> <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 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 (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> <if test="parentId != null "> and d.parent_id = #{parentId}</if>
</where> </where>
</select> </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 id="checkDeptExistUser" parameterType="Long" resultType="int">
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0' select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
</select> </select>

Loading…
Cancel
Save