diff --git a/lzbi-admin/src/main/resources/application-dev.yml b/lzbi-admin/src/main/resources/application-dev.yml index 8cb79c8..6ca3aa1 100644 --- a/lzbi-admin/src/main/resources/application-dev.yml +++ b/lzbi-admin/src/main/resources/application-dev.yml @@ -11,7 +11,7 @@ spring: # 端口,默认为6379 port: 7000 # 数据库索引 - database: 15 + database: 14 # 密码 password: redis123 # 连接超时时间 diff --git a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseAssetInfoController.java b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseAssetInfoController.java index 2ce56f5..bdfceb5 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseAssetInfoController.java +++ b/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 com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; 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 org.springframework.security.access.prepost.PreAuthorize; 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.core.page.TableDataInfo; +import java.util.ArrayList; import java.util.List; /** @@ -33,7 +38,7 @@ import java.util.List; @RequestMapping("/lzbi/assetInfo") public class DcBaseAssetInfoController extends BaseController { @Autowired - private IDcBaseAssetInfoService dcBaseAssetInfoService; + private DcBaseAssetInfoService dcBaseAssetInfoService; /** * 查询资产信息列表 @@ -96,4 +101,65 @@ public class DcBaseAssetInfoController extends BaseController { public AjaxResult remove(@PathVariable Long[] 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 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 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)); + } + + } diff --git a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBusiWorkReadConfigController.java b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBusiWorkReadConfigController.java index 6c61552..b0e38bf 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBusiWorkReadConfigController.java +++ b/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.github.pagehelper.PageHelper; import com.lzbi.asset.domain.DcBusiWorkReadConfig; +import com.lzbi.asset.service.DcBaseAssetInfoService; import com.lzbi.asset.service.DcBusiWorkReadConfigService; -import com.lzbi.asset.service.IDcBaseAssetInfoService; import com.lzbi.common.AssetQueryParams; import com.lzbi.common.annotation.Log; import com.lzbi.common.core.controller.BaseController; @@ -41,7 +41,7 @@ public class DcBusiWorkReadConfigController extends BaseController { @Autowired private DcBaseWorkSpecialService specialService; @Autowired - private IDcBaseAssetInfoService assetInfoService; + private DcBaseAssetInfoService assetInfoService; /** * 查询互联参数读取数据对照列表 diff --git a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java index 1181f85..61fb367 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java @@ -1,11 +1,10 @@ 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.core.domain.BaseEntity; +import com.lzbi.module.base.BaseModuleEntity; +import lombok.Data; +import lombok.experimental.Accessors; /** * 资产信息对象 dc_base_asset_info @@ -13,54 +12,12 @@ import com.lzbi.common.core.domain.BaseEntity; * @author Lu.JL * @date 2023-11-27 */ -public class DcBaseAssetInfo extends BaseEntity { +@Data +//@TableName("dc_base_work_special") +@Accessors(chain = true) +public class DcBaseAssetInfo extends BaseModuleEntity { private static final long serialVersionUID = 1L; - /** - * 租户号 - */ - private String tenantId; - - /** - * 乐观锁 - */ - private Long REVISION; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - - /** - * 删除人 - */ - private String deleteBy; - - /** - * 删除时间 - */ - private Date deleteTime; - - /** - * 资产ID - */ - private Long id; - /** * 资产名称 */ @@ -114,172 +71,12 @@ public class DcBaseAssetInfo extends BaseEntity { */ @Excel(name = "所属组织结构") private Long deptId; - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getTenantId() { - return tenantId; - } - - public void setREVISION(Long REVISION) { - this.REVISION = REVISION; - } - - public Long getREVISION() { - return REVISION; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedTime(Date createdTime) { - this.createdTime = createdTime; - } - - public Date getCreatedTime() { - return createdTime; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public String getUpdatedBy() { - return updatedBy; + public String getValue() { + return this.assetCode; } - 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 toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("tenantId", getTenantId()) - .append("REVISION", getREVISION()) - .append("createdBy", getCreatedBy()) - .append("createdTime", getCreatedTime()) - .append("updatedBy", getUpdatedBy()) - .append("updatedTime", getUpdatedTime()) - .append("deleteBy", getDeleteBy()) - .append("deleteTime", getDeleteTime()) - .append("id", getId()) - .append("assetName", getAssetName()) - .append("assetCode", getAssetCode()) - .append("assetClass", getAssetClass()) - .append("flagValidateDept", getFlagValidateDept()) - .append("flagValidateRole", getFlagValidateRole()) - .append("flagValidateUser", getFlagValidateUser()) - .append("statusAsset", getStatusAsset()) - .append("comanyId", getComanyId()) - .append("deptId", getDeptId()) - .toString(); + public String getLabel() { + return this.assetName; } } diff --git a/lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java b/lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java index 819b6fd..3fdc95e 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java @@ -1,17 +1,22 @@ package com.lzbi.asset.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.lzbi.asset.domain.DcBaseAssetInfo; +import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.List; - /** * 资产信息Mapper接口 * * @author Lu.JL - * @date 2023-11-27 + * @date 2023-12-10 */ -public interface DcBaseAssetInfoMapper { + +@Service +public interface DcBaseAssetInfoMapper extends BaseMapper +{ /** * 查询资产信息 * @@ -20,6 +25,8 @@ public interface DcBaseAssetInfoMapper { */ public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id); public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetcode); + public HashMap selectDcBaseAssetInfoMap(); + /** * 查询资产信息列表 * @@ -59,4 +66,8 @@ public interface DcBaseAssetInfoMapper { * @return 结果 */ public int deleteDcBaseAssetInfoByIds(Long[] ids); + + + + } diff --git a/lzbi-module/src/main/java/com/lzbi/asset/service/DcBaseAssetInfoService.java b/lzbi-module/src/main/java/com/lzbi/asset/service/DcBaseAssetInfoService.java new file mode 100644 index 0000000..3bee66d --- /dev/null +++ b/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 implements IService +{ + + /** + * 查询资产信息 + * + * @param id 资产信息主键 + * @return 资产信息 + */ + public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id) + { + return baseMapper.selectDcBaseAssetInfoById(id); + } + + /** + * 查询资产信息列表 + * + * @param dcBaseAssetInfo 资产信息 + * @return 资产信息 + */ + public List 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); + } + + +} diff --git a/lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java b/lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java index 2c5cbb2..0bc18a8 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java @@ -3,6 +3,7 @@ package com.lzbi.asset.service; import com.lzbi.asset.domain.DcBaseAssetInfo; +import java.util.HashMap; import java.util.List; /** @@ -20,6 +21,8 @@ public interface IDcBaseAssetInfoService { */ public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id); public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode); + //add by zhousq 2023-12-12 获取资产信息Map映射便于存储查询 + public HashMap selectDcBaseAssetInfoMap(); /** * 查询资产信息列表 * diff --git a/lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java b/lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java index d7f3335..03827ad 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.lzbi.asset.service.impl; +import java.util.HashMap; import java.util.List; import com.lzbi.asset.domain.DcBaseAssetInfo; @@ -33,6 +34,10 @@ public class DcBaseAssetInfoServiceImpl implements IDcBaseAssetInfoService { public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode) { return dcBaseAssetInfoMapper.selectDcBaseAssetInfoByCode(assetCode); } + @Override + public HashMap selectDcBaseAssetInfoMap(){ + return dcBaseAssetInfoMapper.selectDcBaseAssetInfoMap(); + } /** * 查询资产信息列表 * diff --git a/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java index 500463a..5c8e03a 100644 --- a/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java +++ b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java @@ -52,7 +52,7 @@ public class DcBusiDataScreenMainController extends BaseController{ @GetMapping("/coalLostRate") public AjaxResult getCoalLostRate() { - String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM"); + String qdate= "2023-11";//DateUtil.format(DateUtil.date(),"yyyy-MM"); List maps = dcBusiDataScreenMainService.selectCoalLostByDate(qdate); JSONArray product=new JSONArray(); JSONArray realcost=new JSONArray(); @@ -81,7 +81,7 @@ public class DcBusiDataScreenMainController extends BaseController{ @GetMapping("/powerInfoAll") public AjaxResult getPowerInfoAll() { - String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM"); + String qdate= "2023-11"; //DateUtil.format(DateUtil.date(),"yyyy-MM"); List maps = dcBusiDataScreenMainService.selectPowerAll(qdate); JSONArray list=new JSONArray(); AtomicReference unit = new AtomicReference<>(); @@ -103,7 +103,7 @@ public class DcBusiDataScreenMainController extends BaseController{ @GetMapping("/squareInfoCompany") public AjaxResult getSquareInfoCompany() { - String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM"); + String qdate= "2023-11"; //DateUtil.format(DateUtil.date(),"yyyy-MM"); List real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate); List self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate); List group = dcBusiDataScreenMainService.selectSquareGroup(qdate); @@ -144,7 +144,7 @@ public class DcBusiDataScreenMainController extends BaseController{ @GetMapping("/squareInfoGroup") public AjaxResult getSquareInfoGroup() { - String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM"); + String qdate= "2023-11";//DateUtil.format(DateUtil.date(),"yyyy-MM"); List real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate); List self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate); List group = dcBusiDataScreenMainService.selectSquareGroup(qdate); @@ -221,7 +221,7 @@ public class DcBusiDataScreenMainController extends BaseController{ * */ @GetMapping("/powerLostRate") public AjaxResult getPowerLostRate(){ - String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM"); + String qdate= "2023-11";//DateUtil.format(DateUtil.date(),"yyyy-MM"); List data = dcBusiDataScreenMainService.selectDataPowerLost(qdate); JSONArray product=new JSONArray(); JSONArray realcost=new JSONArray(); @@ -246,7 +246,7 @@ public class DcBusiDataScreenMainController extends BaseController{ * */ @GetMapping("/waterInfo") public AjaxResult getWaterInfo(){ - String qdate= DateUtil.format(DateUtil.date(),"yyyy-MM"); + String qdate= "2023-11";// DateUtil.format(DateUtil.date(),"yyyy-MM"); List data_1 = dcBusiDataScreenMainService.selectDataWaterLostFirst(qdate); List data_2 = dcBusiDataScreenMainService.selectDataWaterLostSecond(qdate); List data_3 = dcBusiDataScreenMainService.selectDataWaterLostStationAll(qdate); diff --git a/lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java b/lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java index 37fa846..da7d40a 100644 --- a/lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java +++ b/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.DcBusiParamSource; +import com.lzbi.asset.service.DcBaseAssetInfoService; import com.lzbi.asset.service.DcBusiParamSourceService; -import com.lzbi.asset.service.IDcBaseAssetInfoService; import com.lzbi.common.core.controller.BaseController; import com.lzbi.common.core.domain.AjaxResult; import com.lzbi.common.core.domain.TreeSelect; @@ -19,6 +19,7 @@ import org.springframework.lang.Nullable; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Optional; /** * @auth create by Administrator @@ -34,7 +35,7 @@ public class SelectOptionsControl extends BaseController { @Autowired DcBaseWorkSpecialService dcBaseWorkSpecialService; @Autowired - IDcBaseAssetInfoService dcBaseAssetInfoService; + DcBaseAssetInfoService dcBaseAssetInfoService; @Autowired DcBusiParamSourceService dcBusiParamSourceService; @Autowired @@ -104,8 +105,8 @@ public class SelectOptionsControl extends BaseController { { DcBaseAssetInfo dcBaseAssetInfo=new DcBaseAssetInfo(); //dcBaseAssetInfo.setAssetClass(assetQueryParams.getFieldCode()); - dcBaseAssetInfo.setComanyId(assetQueryParams.getCompanyID()); - dcBaseAssetInfo.setDeptId(assetQueryParams.getOrgID()); + dcBaseAssetInfo.setComanyId(Optional.ofNullable(assetQueryParams.getCompanyID()).orElse(0L)); + dcBaseAssetInfo.setDeptId(Optional.ofNullable(assetQueryParams.getOrgID()).orElse(0L)); return AjaxResult.success(dcBaseAssetInfoService.selectDcBaseAssetInfoList(dcBaseAssetInfo)); } //根据条件获取统计单元指标列表 @@ -115,6 +116,17 @@ public class SelectOptionsControl extends BaseController { { DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao(); dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode()); + dcBaseAssetTargetDao.setColumnType(null); + //dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId()); + return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao)); + } + @PostMapping("/assetParam/list") + public AjaxResult getAssetParamSelectList(@RequestBody AssetQueryParams assetQueryParams) + { + DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao(); + dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode()); + dcBaseAssetTargetDao.setTargetField(assetQueryParams.getFieldCode()); + dcBaseAssetTargetDao.setColumnType("P"); //dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId()); return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao)); } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiBillModelMasterController.java b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiBillModelMasterController.java new file mode 100644 index 0000000..3d7e4bb --- /dev/null +++ b/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 list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(DcBusiBillModelMaster); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java index 07c579a..e0e8794 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java @@ -1,19 +1,38 @@ package com.lzbi.draft.controller; +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.lzbi.code.domain.DcBaseCoderuleDefineDao; +import com.lzbi.code.domain.DcBusiCoderuleConfigDao; +import com.lzbi.code.service.CodeNoGenerater; +import com.lzbi.code.service.DcBaseCoderuleDefineService; import com.lzbi.common.annotation.Log; import com.lzbi.common.core.controller.BaseController; import com.lzbi.common.core.domain.AjaxResult; +import com.lzbi.common.core.domain.model.LoginUser; import com.lzbi.common.core.page.TableDataInfo; import com.lzbi.common.enums.BusinessType; +import com.lzbi.common.utils.SecurityUtils; +import com.lzbi.common.utils.StringUtils; import com.lzbi.common.utils.poi.ExcelUtil; +import com.lzbi.draft.domain.DcBusiBillModelMaster; +import com.lzbi.draft.domain.DcBusiBillModelSub; import com.lzbi.draft.domain.DcBusiParamBillMaster; +import com.lzbi.draft.domain.DcBusiParamBillSub; +import com.lzbi.draft.service.DcBusiBillModelMasterService; import com.lzbi.draft.service.DcBusiParamBillMasterService; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; +import java.util.Optional; /** * 参数采集(录入)单据主Controller @@ -25,20 +44,177 @@ import java.util.List; @RequestMapping("/draft/paramCollect") public class DcBusiParamCollectBill extends BaseController { + @Autowired + private DcBusiBillModelMasterService dcBusiBillModelMasterService; @Autowired private DcBusiParamBillMasterService dcBusiParamBillMasterService; + @Autowired + private DcBaseCoderuleDefineService dcBaseCoderuleDefineService; + @Autowired + private CodeNoGenerater codeNoGenerater; /** - * 查询参数采集(录入)单据主列表 + * 查询参数采集(录入) + * 根据 */ - @PreAuthorize("@ss.hasPermi('param:paramData:list')") + // @PreAuthorize("@ss.hasPermi('param:paramData:list')") @GetMapping("/list") public TableDataInfo list(DcBusiParamBillMaster dcBusiParamBillMasterDao) { startPage(); - List list = dcBusiParamBillMasterService.selectDcBusiParamBillMasterDaoList(dcBusiParamBillMasterDao); + //List 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 list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(dcBusiBillModelMaster); return getDataTable(list); } + /** + * 根据根据公司查询模版,现根据角色ID进行过滤 + * 根据 + */ + @ApiOperation("根据根据公司查询模版,现根据角色ID进行过滤") + @ApiImplicitParams({ + @ApiImplicitParam(name = "companyId", value = "", dataType = "Long", dataTypeClass = Long.class), + }) + //@PreAuthorize("@ss.hasPermi('param:paramData:list')") + @GetMapping("/roleModellist/{companyId}") + public TableDataInfo getRoleModellist(@PathVariable Long companyId) + { + DcBusiBillModelMaster dcBusiBillModelMaster=new DcBusiBillModelMaster(); + LoginUser loginUser = SecurityUtils.getLoginUser(); + dcBusiBillModelMaster.setCompanyId(Optional.ofNullable(companyId).orElse(null)); + dcBusiBillModelMaster.setRoleId(loginUser.getUser().getRoleId()); + startPage(); + List 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 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 dcBusiBillModelSubList=new ArrayList<>(); + List 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 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); + } } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelMaster.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelMaster.java new file mode 100644 index 0000000..cac6eb6 --- /dev/null +++ b/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 dcBusiBillModelSubList; + +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelSub.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelSub.java new file mode 100644 index 0000000..7ed18e8 --- /dev/null +++ b/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; +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillMaster.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillMaster.java index c0bc7ae..83a9cae 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillMaster.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillMaster.java @@ -1,5 +1,6 @@ package com.lzbi.draft.domain; +import com.alibaba.fastjson2.JSONArray; import com.baomidou.mybatisplus.annotation.IdType; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -49,7 +50,7 @@ public class DcBusiParamBillMaster extends BaseModuleEntity private String checkStatus ; /** 公司ID */ @ApiModelProperty(name = "公司ID",notes = "") - private Integer companyId ; + private Long companyId ; /** 公司名称 */ @ApiModelProperty(name = "公司名称",notes = "") private String companyName ; @@ -58,17 +59,27 @@ public class DcBusiParamBillMaster extends BaseModuleEntity private String organizeName ; /** 组织机构ID */ @ApiModelProperty(name = "组织机构ID",notes = "") - private Integer oragnizeId ; - /** 统计单元编码 */ - @ApiModelProperty(name = "统计单元编码",notes = "") - private String assetCode ; - /** 统计单元名称 */ - @ApiModelProperty(name = "统计单元名称",notes = "") - private String assetName ; - + private Long oragnizeId ; + /** 统计单元编码 --不在主单据中了*/ +// @ApiModelProperty(name = "统计单元编码",notes = "") +// private String assetCode ; +// /** 统计单元名称 */ +// @ApiModelProperty(name = "统计单元名称",notes = "") +// private String assetName ; + @ApiModelProperty(name = "单据名称",notes = "") + private String billName ; + @ApiModelProperty(name = "统计日期",notes = "") + private String countDate ; + @ApiModelProperty(name = "统计整点数",notes = "") + private String countTimes; + @ApiModelProperty(name = "专业编码",notes = "") + private String fieldCode; + @ApiModelProperty(name = "专业名称",notes = "") + private String fieldName; /** 参数数据采集(录入)明细信息 */ private List dcBusiParamBillSubList; - + @ApiModelProperty(name = "data数组数据未转换",notes = "") + private JSONArray subDatas; diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java index 8f00cb4..c5eeac2 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java @@ -41,8 +41,11 @@ public class DcBusiParamBillSub extends BaseModuleEntity{ @ApiModelProperty(name = "统计单元名称",notes = "") private String assetName ; /** 所属专业 */ - @ApiModelProperty(name = "所属专业",notes = "") - private String fieldType ; + @ApiModelProperty(name = "所属专业编码",notes = "") + private String fieldCode ; + /** 所属专业 */ + @ApiModelProperty(name = "所属专业名称",notes = "") + private String fieldName ; /** 指标名称 */ @ApiModelProperty(name = "指标名称",notes = "") private String paramName ; @@ -60,6 +63,7 @@ public class DcBusiParamBillSub extends BaseModuleEntity{ private String countDate ; @ApiModelProperty(name = "统计小时",notes = "24小时") private Integer countHour ; + public String getAssetCode(){ return Optional.ofNullable(this.assetCode).orElse(""); } @@ -69,7 +73,7 @@ public class DcBusiParamBillSub extends BaseModuleEntity{ public String getCountDate(){ return Optional.ofNullable(this.countDate).orElse(""); } - public String getFieldType(){ - return Optional.ofNullable(this.fieldType).orElse(""); + public String getFieldCode(){ + return Optional.ofNullable(this.fieldCode).orElse(""); } } \ No newline at end of file diff --git a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiBillModelMasterMapper.java b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiBillModelMasterMapper.java new file mode 100644 index 0000000..068ca3e --- /dev/null +++ b/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 +{ + /** + * 查询录入配置 + * + * @param id 录入配置主键 + * @return 录入配置 + */ + public DcBusiBillModelMaster selectDcBusiBillModelMasterById(Long id); + + /** + * 查询录入配置列表 + * + * @param dcBusiBillModelMaster 录入配置 + * @return 录入配置集合 + */ + public List 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 dcBusiBillModelSubList); + + + /** + * 通过录入配置主键删除数据录入单模版子信息 + * + * @param id 录入配置ID + * @return 结果 + */ + public int deleteDcBusiBillModelSubByBillModelNo(Long id); +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiBillModelMasterService.java b/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiBillModelMasterService.java new file mode 100644 index 0000000..9676217 --- /dev/null +++ b/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 implements IService +{ + + /** + * 查询录入配置 + * + * @param id 录入配置主键 + * @return 录入配置 + */ + public DcBusiBillModelMaster selectDcBusiBillModelMasterById(Long id) + { + return baseMapper.selectDcBusiBillModelMasterById(id); + } + + /** + * 查询录入配置列表 + * + * @param dcBusiBillModelMaster 录入配置 + * @return 录入配置 + */ + public List 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 dcBusiBillModelSubDaoList = dcBusiBillModelMaster.getDcBusiBillModelSubList(); + String billNo = dcBusiBillModelMaster.getBillModelNo(); + if (StringUtils.isNotNull(dcBusiBillModelSubDaoList)) + { + List list = new ArrayList(); + for (DcBusiBillModelSub dcBusiBillModelSubDao : dcBusiBillModelSubDaoList) + { + dcBusiBillModelSubDao.setBillModelNo(billNo); + list.add(dcBusiBillModelSubDao); + } + if (list.size() > 0) + { + baseMapper.batchDcBusiBillModelSub(list); + } + } + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java b/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java index 93c2ae1..675fe79 100644 --- a/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java +++ b/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.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -18,35 +22,14 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-11-28 */ @Data +@NoArgsConstructor +@AllArgsConstructor @Accessors(chain = true) +@ApiModel(value = "参数数据采集(录入)明细表",description = "") +@TableName("dc_base_work_special") public class DcBaseWorkSpecial extends BaseModuleEntity { private static final long serialVersionUID = 1L; - - /** 租户号 */ - private String tenantId; - - /** 乐观锁 */ - private Long REVISION; - - /** 创建人 */ - private String createdBy; - - /** 创建时间 */ - private Date createdTime; - - /** 更新人 */ - private String updatedBy; - - /** 更新时间 */ - private Date updatedTime; - - /** 删除人 */ - private String deleteBy; - - /** 删除时间 */ - private Date deleteTime; - @TableId(value = "id", type = IdType.AUTO) /** 主键 */ private Long id; diff --git a/lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java b/lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java index 90815f6..562ac42 100644 --- a/lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java @@ -1,5 +1,6 @@ package com.lzbi.special.mapper; +import java.util.HashMap; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -63,4 +64,5 @@ public interface DcBaseWorkSpecialMapper extends BaseMapper * @return 结果 */ public int deleteDcBaseWorkSpecialByIds(Long[] ids); + public HashMap getDcBaseWorkSpecialMap(); } diff --git a/lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java b/lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java index 79fda5c..d4a5cb9 100644 --- a/lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java +++ b/lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java @@ -1,5 +1,6 @@ package com.lzbi.special.service; +import java.util.HashMap; import java.util.List; import com.lzbi.common.utils.DateUtils; @@ -99,4 +100,11 @@ public class DcBaseWorkSpecialService extends ServiceImpl getDcBaseWorkSpecialMap(){ + return baseMapper.getDcBaseWorkSpecialMap(); + } } diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java index 9503289..c017b6f 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java @@ -2,6 +2,10 @@ package com.lzbi.targetFolder.domain; import java.math.BigDecimal; import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; @@ -18,7 +22,7 @@ import lombok.experimental.Accessors; public class DcBaseAssetTargetDao extends BaseModuleEntity { private static final long serialVersionUID = 1L; - + @TableId(value = "id", type = IdType.AUTO) /** 主键 */ private Long id; @@ -76,6 +80,13 @@ public class DcBaseAssetTargetDao extends BaseModuleEntity /** 统计单元编码 */ @Excel(name = "统计单元编码") private String assetCode; + //add by zhousq 2023-12-12 + @ApiModelProperty("所属专业名称") + private String targetFieldName; + @ApiModelProperty("单位") + private String fieldUnit; + @ApiModelProperty("字段类型") + private String columnType; private String value; private String label; diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java index 8f86879..83d0fd4 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java @@ -40,6 +40,7 @@ public interface DcBaseAssetTargetMapper extends BaseMapper selectDcBaseAssetTargetDaoList(DcBaseAssetTargetDao dcBaseAssetTargetDao); + /** * 新增资产指标配置 * diff --git a/lzbi-module/src/main/java/com/lzbi/task/TaskParamDfratProcess.java b/lzbi-module/src/main/java/com/lzbi/task/TaskParamDfratProcess.java index d275852..faa2b42 100644 --- a/lzbi-module/src/main/java/com/lzbi/task/TaskParamDfratProcess.java +++ b/lzbi-module/src/main/java/com/lzbi/task/TaskParamDfratProcess.java @@ -36,7 +36,7 @@ public class TaskParamDfratProcess { DcBusiParamBillSub billSub=new DcBusiParamBillSub(); billSub.setBillNo(billMasterDao.getBillNo()); List dcBusiParamBillSubs = dcBusiParamBillSubService.selectByVo(billSub); - Map> collect = dcBusiParamBillSubs.stream().collect(Collectors.groupingBy(gp -> gp.getAssetCode() + ":" + gp.getParamCode() + ":" + gp.getFieldType() + ":" + gp.getCountDate())); + Map> collect = dcBusiParamBillSubs.stream().collect(Collectors.groupingBy(gp -> gp.getAssetCode() + ":" + gp.getParamCode() + ":" + gp.getFieldCode() + ":" + gp.getCountDate())); collect.forEach((key,value)->{ String[] s=key.split(":"); ParamDraftQueryVo queryVo=new ParamDraftQueryVo(); @@ -50,7 +50,7 @@ public class TaskParamDfratProcess { if(StringUtils.isNull(dcBusiParamDraftDay.getId())){ dcBusiParamDraftDay.setCreatedTime(DateUtil.date()); dcBusiParamDraftDay.setCreatedBy("task"); - dcBusiParamDraftDay.setParamFieldCode(val.getFieldType()); + dcBusiParamDraftDay.setParamFieldCode(val.getFieldCode()); dcBusiParamDraftDay.setParamCode(val.getParamCode()); dcBusiParamDraftDay.setCountDate(val.getCountDate()); dcBusiParamDraftDay.setAssetCode(val.getAssetCode()); diff --git a/lzbi-module/src/main/java/com/lzbi/task/TaskWorkParamRead.java b/lzbi-module/src/main/java/com/lzbi/task/TaskWorkParamRead.java index 3f5ddb2..0d06c93 100644 --- a/lzbi-module/src/main/java/com/lzbi/task/TaskWorkParamRead.java +++ b/lzbi-module/src/main/java/com/lzbi/task/TaskWorkParamRead.java @@ -21,6 +21,7 @@ import com.lzbi.task.service.WorkParamReadService; import org.springframework.stereotype.Component; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -118,7 +119,7 @@ public class TaskWorkParamRead { Double va=item.getValueByType(find.get().getGoalParamType()); subDao.setParamValue(va); subDao.setParamCode(find.get().getAssetParamCode()); - subDao.setFieldType(find.get().getAssetFieldCode()); + subDao.setFieldCode(find.get().getAssetFieldCode()); subDao.setCountDate(item.getDateCount()); subDao.setCountHour(item.getHourCount()); billSub.add(subDao); @@ -127,4 +128,5 @@ public class TaskWorkParamRead { billm.setDcBusiParamBillSubList(billSub); return dcBusiParamBillMasterService.insertDcBusiParamBillMasterDao(billm); } + } diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml index 4c89f6f..004055c 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml @@ -75,6 +75,12 @@ where asset_code = #{assetCode} + + insert into dc_base_asset_info diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml index 38cfcc3..6fa61b2 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml @@ -101,4 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + \ No newline at end of file diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml index 09bf92a..c1f9098 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml @@ -19,6 +19,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + @@ -36,7 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + @@ -61,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + and dept_id = #{deptId} + and role_id = #{roleId} + and bill_model_no = #{billModelNo} + and bill_model_name like concat('%', #{billModelName}, '%') + and field_code = #{fieldCode} + and company_name like concat('%', #{companyName}, '%') + and company_id = #{companyId} + and bill_model_point = #{billModelPoint} + and org_name like concat('%', #{orgName}, '%') + and org_id = #{orgId} + and data_state = #{dataState} + and use_state = #{useState} + and field_name like concat('%', #{fieldName}, '%') + + + + + + + insert into dc_busi_bill_model_master + + 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, + data_state, + use_state, + field_name, + + + #{tenantId}, + #{revision}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + #{deleteBy}, + #{deleteTime}, + #{deptId}, + #{roleId}, + #{billModelNo}, + #{billModelName}, + #{fieldCode}, + #{companyName}, + #{companyId}, + #{billModelPoint}, + #{orgName}, + #{orgId}, + #{dataState}, + #{useState}, + #{fieldName}, + + + + + update dc_busi_bill_model_master + + tenant_id = #{tenantId}, + revision = #{revision}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, + delete_by = #{deleteBy}, + delete_time = #{deleteTime}, + dept_id = #{deptId}, + role_id = #{roleId}, + bill_model_no = #{billModelNo}, + bill_model_name = #{billModelName}, + field_code = #{fieldCode}, + company_name = #{companyName}, + company_id = #{companyId}, + bill_model_point = #{billModelPoint}, + org_name = #{orgName}, + org_id = #{orgId}, + data_state = #{dataState}, + use_state = #{useState}, + field_name = #{fieldName}, + + where id = #{id} + + + + delete from dc_busi_bill_model_master where id = #{id} + + + + delete from dc_busi_bill_model_master where id in + + #{id} + + + + + delete from dc_busi_bill_model_sub where bill_model_no in + + #{billModelNo} + + + + + delete from dc_busi_bill_model_sub where bill_model_no = #{billModelNo} + + + + 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 + + ( #{item.billModelNo}, #{item.assetCode}, #{item.assetName}, #{item.assetUnitCode}, #{item.assetUnitName}, #{item.assetUnitType}, #{item.id}, #{item.assetId}) + + + \ No newline at end of file diff --git a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml index 1e13ed6..c3ac296 100644 --- a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml +++ b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml @@ -1,17 +1,15 @@ +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - @@ -20,6 +18,7 @@ + @@ -28,50 +27,43 @@ + + + - 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 + - - - + insert into dc_base_asset_target - asset_code, asset_id, target_model_code, target_name, - target_name_alias, target_code, target_field, limit_up, @@ -80,6 +72,7 @@ flag_avg, flag_sum, flag_compute, + sort, tenant_id, revision, created_by, @@ -88,13 +81,11 @@ updated_time, delete_by, delete_time, - + - #{assetCode}, #{assetId}, #{targetModelCode}, #{targetName}, - #{targetNameAlias}, #{targetCode}, #{targetField}, #{limitUp}, @@ -103,6 +94,7 @@ #{flagAvg}, #{flagSum}, #{flagCompute}, + #{sort}, #{tenantId}, #{revision}, #{createdBy}, @@ -111,17 +103,15 @@ #{updatedTime}, #{deleteBy}, #{deleteTime}, - + update dc_base_asset_target - asset_code = #{assetCode}, asset_id = #{assetId}, target_model_code = #{targetModelCode}, target_name = #{targetName}, - target_name_alias = #{targetNameAlias}, target_code = #{targetCode}, target_field = #{targetField}, limit_up = #{limitUp}, @@ -130,6 +120,7 @@ flag_avg = #{flagAvg}, flag_sum = #{flagSum}, flag_compute = #{flagCompute}, + sort = #{sort}, tenant_id = #{tenantId}, revision = #{revision}, created_by = #{createdBy}, @@ -147,7 +138,7 @@ - delete from dc_base_asset_target where id in + delete from dc_base_asset_target where id in #{id} diff --git a/lzbi-system/src/main/java/com/lzbi/system/mapper/SysDeptMapper.java b/lzbi-system/src/main/java/com/lzbi/system/mapper/SysDeptMapper.java index 2312ae5..7a4d74f 100644 --- a/lzbi-system/src/main/java/com/lzbi/system/mapper/SysDeptMapper.java +++ b/lzbi-system/src/main/java/com/lzbi/system/mapper/SysDeptMapper.java @@ -1,5 +1,6 @@ package com.lzbi.system.mapper; +import java.util.HashMap; import java.util.List; import org.apache.ibatis.annotations.Param; import com.lzbi.common.core.domain.entity.SysDept; @@ -118,4 +119,6 @@ public interface SysDeptMapper //add by zhousq 2023-12 根据部门类别筛选部门 public List selectOrg(Long parentId); public List selectCompany(Long parentId); + public HashMap selectDeptMap(); + } diff --git a/lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java b/lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java index 1ac5ba4..80e68d5 100644 --- a/lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java +++ b/lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java @@ -1,5 +1,6 @@ package com.lzbi.system.service; +import java.util.HashMap; import java.util.List; import com.lzbi.common.core.domain.TreeSelect; import com.lzbi.common.core.domain.entity.SysDept; @@ -124,5 +125,6 @@ public interface ISysDeptService public List selectOrg(Long parentId); public List selectCompany(Long parentId); + public HashMap selectDeptMap(); } diff --git a/lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java b/lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java index 307cd78..97a2380 100644 --- a/lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java +++ b/lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java @@ -1,6 +1,7 @@ package com.lzbi.system.service.impl; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; @@ -313,6 +314,11 @@ public class SysDeptServiceImpl implements ISysDeptService { public List selectCompany(Long parentId){ return deptMapper.selectCompany(parentId); } + @Override + //获取所有部门的hash映射,便于查询(key :depid,value:deptName) + public HashMap selectDeptMap(){ + return deptMapper.selectDeptMap(); + } /** * 递归列表 */ diff --git a/lzbi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/lzbi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 1795541..a7faba3 100644 --- a/lzbi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/lzbi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -77,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and d.parent_id = #{parentId} + + +