Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
zhousq 11 months ago
parent
commit
f6e87d5771
  1. 14
      lzbi-admin/src/main/resources/application-test.yml
  2. 176
      lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiMonthPlanBillMasterController.java
  3. 96
      lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiMonthPlanBillMaster.java
  4. 91
      lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiMonthPlanBillSub.java
  5. 77
      lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiMonthPlanBillMasterMapper.java
  6. 65
      lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiMonthPlanBillSubMapper.java
  7. 15
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiDayPlanBillMasterService.java
  8. 280
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiMonthPlanBillMasterService.java
  9. 91
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiMonthPlanBillSubService.java
  10. 2
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java
  11. 2
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java
  12. 155
      lzbi-module/src/main/resources/mapper/asset/DcBusiMonthPlanBillMasterMapper.xml
  13. 136
      lzbi-module/src/main/resources/mapper/asset/DcBusiMonthPlanBillSubMapper.xml
  14. 13
      lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml

14
lzbi-admin/src/main/resources/application-test.yml

@ -106,3 +106,17 @@ logging:
level:
com.lzbi: debug
org.springframework: warn
# 指标模板
target-model:
user: TM000YH # 用户
boiler: TM000GL # 锅炉
electricityConsumes: TM000DH #电耗
waterConsumes: TM000SH # 水耗
coalConsumes: TM000MH # 煤耗
calorific: TM000FRL # 发热量
heatSupplied: TM000GRL # 供热量
acreage: MJ01 # 面积
outputOfPlant: TM000FDL # 发电量
provideWaterAverageTemperature: TM000GSJW # 供水均温
answerWaterAverageTemperature: TM000HSJW # 回水均温

176
lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiMonthPlanBillMasterController.java

@ -0,0 +1,176 @@
package com.lzbi.bill.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.bill.domain. DcBusiMonthPlanBillMaster;
import com.lzbi.bill.service.DcBusiMonthPlanBillMasterService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
/**
* 月计划单据Controller
*
* @author lienbo
* @date 2023-12-26
*/
@RestController
@RequestMapping("/bill/monthPlanBill")
public class DcBusiMonthPlanBillMasterController extends BaseController
{
@Autowired
private DcBusiMonthPlanBillMasterService dcBusiMonthPlanBillMasterService;
/**
* 查询月计划单据列表
*/
@ApiOperation("查询月计划单据列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiMonthPlanBillMaster", value = "", dataType = "DcBusiMonthPlanBillMaster", dataTypeClass = DcBusiMonthPlanBillMaster.class),
})
@PreAuthorize("@ss.hasPermi('bill:monthPlanBill:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiMonthPlanBillMaster DcBusiMonthPlanBillMaster)
{
startPage();
List< DcBusiMonthPlanBillMaster> list = dcBusiMonthPlanBillMasterService.selectDcBusiMonthPlanBillMasterList(DcBusiMonthPlanBillMaster);
return getDataTable(list);
}
/**
* 导出月计划单据列表
*/
@ApiOperation("导出月计划单据列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiMonthPlanBillMaster", value = "", dataType = "DcBusiMonthPlanBillMaster", dataTypeClass = DcBusiMonthPlanBillMaster.class),
})
@PreAuthorize("@ss.hasPermi('bill:monthPlanBill:export')")
@Log(title = "月计划单据", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response,DcBusiMonthPlanBillMaster DcBusiMonthPlanBillMaster)
{
List<DcBusiMonthPlanBillMaster> list = dcBusiMonthPlanBillMasterService.selectDcBusiMonthPlanBillMasterList(DcBusiMonthPlanBillMaster);
ExcelUtil<DcBusiMonthPlanBillMaster> util = new ExcelUtil<DcBusiMonthPlanBillMaster>(DcBusiMonthPlanBillMaster.class);
util.exportExcel(response, list, "月计划单据数据");
}
/**
* 获取月计划单据详细信息
*/
@ApiOperation("获取月计划单据详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class),
})
@PreAuthorize("@ss.hasPermi('bill:monthPlanBill:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiMonthPlanBillMasterService.selectDcBusiMonthPlanBillMasterById(id));
}
/**
* 获取月计划单据详细信息
*/
@ApiOperation("获取月计划单据详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "单据号", dataType = "String", dataTypeClass = String.class),
})
@PreAuthorize("@ss.hasPermi('bill:monthPlanBill:query')")
@GetMapping(value = "/billNo/{billNo}")
public AjaxResult getInfo(@PathVariable("billNo") String billNo)
{
return success(dcBusiMonthPlanBillMasterService.selectDcBusiMonthPlanBillMasterByBillNo(billNo));
}
/**
* 新增月计划单据
*/
@ApiOperation("新增月计划单据")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiMonthPlanBillMaster", value = "", dataType = "DcBusiMonthPlanBillMaster", dataTypeClass = DcBusiMonthPlanBillMaster.class),
})
@PreAuthorize("@ss.hasPermi('bill:monthPlanBill:add')")
@Log(title = "月计划单据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiMonthPlanBillMaster DcBusiMonthPlanBillMaster)
{
return toAjax(dcBusiMonthPlanBillMasterService.insertDcBusiMonthPlanBillMaster(DcBusiMonthPlanBillMaster));
}
/**
* 修改月计划单据
*/
@ApiOperation("修改月计划单据")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiMonthPlanBillMaster", value = "", dataType = "DcBusiMonthPlanBillMaster", dataTypeClass = DcBusiMonthPlanBillMaster.class),
})
@PreAuthorize("@ss.hasPermi('bill:monthPlanBill:edit')")
@Log(title = "月计划单据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiMonthPlanBillMaster DcBusiMonthPlanBillMaster)
{
return toAjax(dcBusiMonthPlanBillMasterService.updateDcBusiMonthPlanBillMaster(DcBusiMonthPlanBillMaster));
}
/**
* 删除月计划单据
*/
@ApiOperation("删除月计划单据")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class),
})
@PreAuthorize("@ss.hasPermi('bill:monthPlanBill:remove')")
@Log(title = "月计划单据", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiMonthPlanBillMasterService.deleteDcBusiMonthPlanBillMasterByIds(ids));
}
@ApiOperation("驳回")
@PreAuthorize("@ss.hasPermi('bill:dayPlanBill:check')")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@PostMapping("/checkBack/{billNo}")
public AjaxResult checkBack(@PathVariable String billNo){
return AjaxResult.success(dcBusiMonthPlanBillMasterService.checkBack(billNo));
}
@ApiOperation("审核")
@PreAuthorize("@ss.hasPermi('bill:dayPlanBill:check')")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@PostMapping("/checkPass/{billNo}")
public AjaxResult checkPass(@PathVariable String billNo){
return AjaxResult.success(dcBusiMonthPlanBillMasterService.checkPass(billNo));
}
@ApiOperation("反审核")
@PreAuthorize("@ss.hasPermi('bill:dayPlanBill:check')")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@PostMapping("/checkRevert/{billNo}")
public AjaxResult checkRevert(@PathVariable String billNo){
return AjaxResult.success(dcBusiMonthPlanBillMasterService.checkRevert(billNo));
}
}

96
lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiMonthPlanBillMaster.java

@ -0,0 +1,96 @@
package com.lzbi.bill.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 月计划单据对象 dc_busi_month_plan_bill_master
*
* @author lienbo
* @date 2023-12-26
*/
@Data
@Accessors(chain = true)
public class DcBusiMonthPlanBillMaster extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 单据编号 */
@Excel(name = "单据编号")
@ApiModelProperty(name = "单据编号",notes = "billNo")
private String billNo;
/** 采集时间 */
@Excel(name = "采集时间")
@ApiModelProperty(name = "采集时间",notes = "billIncomeDate")
private String billIncomeDate;
/** 单据类型 */
@Excel(name = "单据类型")
@ApiModelProperty(name = "单据类型",notes = "billType")
private String billType;
/** 审核类型 */
@Excel(name = "审核类型")
@ApiModelProperty(name = "审核类型",notes = "checkType")
private String checkType;
/** 审核状态 */
@Excel(name = "审核状态")
@ApiModelProperty(name = "审核状态",notes = "checkStatus")
private String checkStatus;
/** 创建人 */
private String createdBy;
/** 创建时间 */
private Date createdTime;
/** 更新人 */
private String updatedBy;
/** 更新时间 */
private Date updatedTime;
/** 公司ID */
@Excel(name = "公司ID")
@ApiModelProperty(name = "公司ID",notes = "companyId")
private Long companyId;
/** 公司名称 */
@Excel(name = "公司名称")
@ApiModelProperty(name = "公司名称",notes = "companyName")
private String companyName;
/** 组织机构名称 */
@Excel(name = "组织机构名称")
@ApiModelProperty(name = "组织机构名称",notes = "organizeName")
private String organizeName;
/** 组织机构ID */
@Excel(name = "组织机构ID")
@ApiModelProperty(name = "组织机构ID",notes = "oragnizeId")
private Long oragnizeId;
/** 所属专业 */
private String fieldCode;
/** 所属专业名称 */
private String fieldName;
/** 计划单据明细信息 */
private List<DcBusiMonthPlanBillSub> subList;
}

91
lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiMonthPlanBillSub.java

@ -0,0 +1,91 @@
package com.lzbi.bill.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 月计划单据明细对象 dc_busi_month_plan_bill_sub
*
* @author lienbo
* @date 2023-12-26
*/
@Data
@Accessors(chain = true)
public class DcBusiMonthPlanBillSub extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 单据编码 */
@Excel(name = "单据编码")
@ApiModelProperty(name = "单据编码",notes = "billNo")
private String billNo;
/** 所属专业 */
@Excel(name = "所属专业")
@ApiModelProperty(name = "所属专业",notes = "fieldCode")
private String fieldCode;
/** 所属专业名称 */
@Excel(name = "所属专业名称")
@ApiModelProperty(name = "所属专业名称",notes = "fieldName")
private String fieldName;
/** 统计单元编码 */
@Excel(name = "统计单元编码")
@ApiModelProperty(name = "统计单元编码",notes = "assetCode")
private String assetCode;
/** 统计单元名称 */
@Excel(name = "统计单元名称")
@ApiModelProperty(name = "统计单元名称",notes = "assetName")
private String assetName;
/** 指标编码 */
@Excel(name = "指标编码")
@ApiModelProperty(name = "指标编码",notes = "targetCode")
private String targetCode;
/** 指标名称 */
@Excel(name = "指标名称")
@ApiModelProperty(name = "指标名称",notes = "targetName")
private String targetName;
/** 参数值 */
@Excel(name = "参数值")
@ApiModelProperty(name = "参数值",notes = "planValue")
private BigDecimal planValue;
/** 年 */
@Excel(name = "年")
@ApiModelProperty(name = "年",notes = "dateYear")
private String dateYear;
/** 月 */
@Excel(name = "月")
@ApiModelProperty(name = "月",notes = "dateMonth")
private String dateMonth;
/** 创建人 */
private String createdBy;
/** 创建时间 */
private Date createdTime;
/** 更新人 */
private String updatedBy;
/** 更新时间 */
private Date updatedTime;
}

77
lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiMonthPlanBillMasterMapper.java

@ -0,0 +1,77 @@
package com.lzbi.bill.mapper;
import java.util.List;
import com.lzbi.bill.domain.DcBusiMonthPlanBillMaster;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 月计划单据Mapper接口
*
* @author lienbo
* @date 2023-12-26
*/
public interface DcBusiMonthPlanBillMasterMapper extends BaseMapper<DcBusiMonthPlanBillMaster>
{
/**
* 查询月计划单据
*
* @param id 月计划单据主键
* @return 月计划单据
*/
public DcBusiMonthPlanBillMaster selectDcBusiMonthPlanBillMasterById(Long id);
/**
* 根据单据号查询
* @param billNo
* @return
*/
DcBusiMonthPlanBillMaster selectDcBusiMonthPlanBillMasterByBillNo(String billNo);
/**
* 查询月计划单据列表
*
* @param dcBusiMonthPlanBillMaster 月计划单据
* @return 月计划单据集合
*/
public List<DcBusiMonthPlanBillMaster> selectDcBusiMonthPlanBillMasterList(DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster);
/**
* 新增月计划单据
*
* @param dcBusiMonthPlanBillMaster 月计划单据
* @return 结果
*/
public int insertDcBusiMonthPlanBillMaster(DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster);
/**
* 修改月计划单据
*
* @param dcBusiMonthPlanBillMaster 月计划单据
* @return 结果
*/
public int updateDcBusiMonthPlanBillMaster(DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster);
/**
* 根据单据号修改
* @param master
* @return
*/
int updateDcBusiMonthPlanBillMasterByBillNo(DcBusiMonthPlanBillMaster master);
/**
* 删除月计划单据
*
* @param id 月计划单据主键
* @return 结果
*/
public int deleteDcBusiMonthPlanBillMasterById(Long id);
/**
* 批量删除月计划单据
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiMonthPlanBillMasterByIds(Long[] ids);
}

65
lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiMonthPlanBillSubMapper.java

@ -0,0 +1,65 @@
package com.lzbi.bill.mapper;
import java.util.List;
import com.lzbi.bill.domain.DcBusiMonthPlanBillSub;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 月计划单据明细Mapper接口
*
* @author lienbo
* @date 2023-12-26
*/
public interface DcBusiMonthPlanBillSubMapper extends BaseMapper<DcBusiMonthPlanBillSub>
{
/**
* 查询月计划单据明细
*
* @param id 月计划单据明细主键
* @return 月计划单据明细
*/
public DcBusiMonthPlanBillSub selectDcBusiMonthPlanBillSubById(Long id);
/**
* 查询月计划单据明细列表
*
* @param dcBusiMonthPlanBillSub 月计划单据明细
* @return 月计划单据明细集合
*/
public List<DcBusiMonthPlanBillSub> selectDcBusiMonthPlanBillSubList(DcBusiMonthPlanBillSub dcBusiMonthPlanBillSub);
/**
* 新增月计划单据明细
*
* @param dcBusiMonthPlanBillSub 月计划单据明细
* @return 结果
*/
public int insertDcBusiMonthPlanBillSub(DcBusiMonthPlanBillSub dcBusiMonthPlanBillSub);
/**
* 修改月计划单据明细
*
* @param dcBusiMonthPlanBillSub 月计划单据明细
* @return 结果
*/
public int updateDcBusiMonthPlanBillSub(DcBusiMonthPlanBillSub dcBusiMonthPlanBillSub);
/**
* 删除月计划单据明细
*
* @param id 月计划单据明细主键
* @return 结果
*/
public int deleteDcBusiMonthPlanBillSubById(Long id);
/**
* 批量删除月计划单据明细
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiMonthPlanBillSubByIds(Long[] ids);
int deleteDcBusiMonthPlanBillSubByBillNo(String billNo);
}

15
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiDayPlanBillMasterService.java

@ -84,14 +84,14 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
* @param dcBusiDayPlanBillMaster 计划单据主
* @return 结果
*/
@Transactional
@Transactional(rollbackFor = Exception.class)
public int insertDcBusiPlanBillMaster(DcBusiDayPlanBillMaster dcBusiDayPlanBillMaster) {
DcBusiDayPlanBillMaster params = new DcBusiDayPlanBillMaster();
params.setBillNo(dcBusiDayPlanBillMaster.getBillNo());
List<DcBusiDayPlanBillMaster> dcBusiDayPlanBillMasters = this.selectDcBusiPlanBillMasterList(params);
// 如果单据号重复了
if (!CollectionUtils.isEmpty(dcBusiDayPlanBillMasters)) {
throw new RuntimeException("单据号已存在,不可重复录入");
throw new RuntimeException("单据号已存在,请重新获取");
}
// 查询公司
SysDept company = sysDeptService.selectDeptById(dcBusiDayPlanBillMaster.getCompanyId());
@ -117,7 +117,6 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
* @return 结果
*/
@Transactional
public int updateDcBusiPlanBillMaster(DcBusiDayPlanBillMaster dcBusiDayPlanBillMaster) {
dcBusiDayPlanBillMaster.setUpdatedTime(DateUtils.getNowDate());
dcBusiDayPlanBillMaster.setUpdatedBy(SecurityUtils.getLoginUser().getUsername());
@ -155,7 +154,7 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew = new DcBusiTargetDraftDaynew();
dcBusiTargetDraftDaynew.setCompanyId(master.getCompanyId());
dcBusiTargetDraftDaynew.setOrganizeId(master.getOragnizeId());
dcBusiTargetDraftDaynew.setFieldCode(master.getFieldCode());
dcBusiTargetDraftDaynew.setFieldCode(subList.get(i).getFieldCode());
dcBusiTargetDraftDaynew.setAssetCode(subList.get(i).getAssetCode());
dcBusiTargetDraftDaynew.setTargetCode(subList.get(i).getTargetCode());
dcBusiTargetDraftDaynew.setDateYear(subList.get(i).getDateYear());
@ -166,10 +165,10 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
if (CollectionUtils.isEmpty(dcBusiTargetDraftDaynews)) {
dcBusiTargetDraftDaynew.setCompanyName(master.getCompanyName());
dcBusiTargetDraftDaynew.setOrganizeName(master.getOrganizeName());
dcBusiTargetDraftDaynew.setFieldName(master.getFieldName());
dcBusiTargetDraftDaynew.setFieldName(subList.get(i).getFieldName());
dcBusiTargetDraftDaynew.setAssetName(subList.get(i).getAssetName());
dcBusiTargetDraftDaynew.setTagetName(subList.get(i).getTargetName());
DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(subList.get(i).getAssetCode(), subList.get(i).getAssetCode());
DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(subList.get(i).getTargetCode(), subList.get(i).getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTarget)) {
dcBusiTargetDraftDaynew.setTargetModelCode(dcBaseAssetTarget.getTargetModelCode());
}
@ -210,7 +209,7 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew = new DcBusiTargetDraftDaynew();
dcBusiTargetDraftDaynew.setCompanyId(master.getCompanyId());
dcBusiTargetDraftDaynew.setOrganizeId(master.getOragnizeId());
dcBusiTargetDraftDaynew.setFieldCode(master.getFieldCode());
dcBusiTargetDraftDaynew.setFieldCode(subList.get(i).getFieldCode());
dcBusiTargetDraftDaynew.setAssetCode(subList.get(i).getAssetCode());
dcBusiTargetDraftDaynew.setTargetCode(subList.get(i).getTargetCode());
dcBusiTargetDraftDaynew.setDateYear(subList.get(i).getDateYear());
@ -268,7 +267,7 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
*/
public void insertDcBusiPlanBillSub(DcBusiDayPlanBillMaster dcBusiDayPlanBillMaster) {
List<DcBusiDayPlanBillSub> dcBusiDayPlanBillSubDaoList = dcBusiDayPlanBillMaster.getDcBusiDayPlanBillSubList();
if (StringUtils.isNotNull(dcBusiDayPlanBillSubDaoList)) {
if (!CollectionUtils.isEmpty(dcBusiDayPlanBillSubDaoList)) {
for (DcBusiDayPlanBillSub dcBusiDayPlanBillSubDao : dcBusiDayPlanBillSubDaoList) {
dcBusiDayPlanBillSubDao.setBillNo(dcBusiDayPlanBillMaster.getBillNo());
dcBusiDayPlanBillSubMapper.insertDcBusiPlanBillSub(dcBusiDayPlanBillSubDao);

280
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiMonthPlanBillMasterService.java

@ -0,0 +1,280 @@
package com.lzbi.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lzbi.bi.domain.DcBusiTargetDraftDaynew;
import com.lzbi.bill.domain.DcBusiDayPlanBillMaster;
import com.lzbi.bill.domain.DcBusiDayPlanBillSub;
import com.lzbi.bill.domain.DcBusiMonthPlanBillMaster;
import com.lzbi.bill.domain.DcBusiMonthPlanBillSub;
import com.lzbi.bill.mapper.DcBusiMonthPlanBillMasterMapper;
import com.lzbi.bill.mapper.DcBusiMonthPlanBillSubMapper;
import com.lzbi.common.core.domain.entity.SysDept;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.common.utils.SecurityUtils;
import com.lzbi.draft.domain.DcBusiTargetDraftMonth;
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper;
import com.lzbi.system.service.impl.SysDeptServiceImpl;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.List;
/**
* 月计划单据Service业务层处理
*
* @author lienbo
* @date 2023-12-26
*/
@Service
public class DcBusiMonthPlanBillMasterService extends ServiceImpl<DcBusiMonthPlanBillMasterMapper, DcBusiMonthPlanBillMaster> implements IService<DcBusiMonthPlanBillMaster>
{
@Autowired
private SysDeptServiceImpl sysDeptService;
@Resource
private DcBusiMonthPlanBillSubMapper dcBusiMonthPlanBillSubMapper;
@Resource
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper;
@Resource
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper;
/**
* 查询月计划单据
*
* @param id 月计划单据主键
* @return 月计划单据
*/
public DcBusiMonthPlanBillMaster selectDcBusiMonthPlanBillMasterById(Long id)
{
return baseMapper.selectDcBusiMonthPlanBillMasterById(id);
}
public DcBusiMonthPlanBillMaster selectDcBusiMonthPlanBillMasterByBillNo(String billNo) {
DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster = baseMapper.selectDcBusiMonthPlanBillMasterByBillNo(billNo);
DcBusiMonthPlanBillSub params = new DcBusiMonthPlanBillSub();
params.setBillNo(billNo);
List<DcBusiMonthPlanBillSub> dcBusiMonthPlanBillSubs = dcBusiMonthPlanBillSubMapper.selectDcBusiMonthPlanBillSubList(params);
if (!CollectionUtils.isEmpty(dcBusiMonthPlanBillSubs)) {
dcBusiMonthPlanBillMaster.setSubList(dcBusiMonthPlanBillSubs);
dcBusiMonthPlanBillMaster.setFieldCode(dcBusiMonthPlanBillSubs.get(0).getFieldCode());
dcBusiMonthPlanBillMaster.setFieldName(dcBusiMonthPlanBillSubs.get(0).getFieldName());
}
return dcBusiMonthPlanBillMaster;
}
/**
* 查询月计划单据列表
*
* @param dcBusiMonthPlanBillMaster 月计划单据
* @return 月计划单据
*/
public List<DcBusiMonthPlanBillMaster> selectDcBusiMonthPlanBillMasterList(DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster)
{
return baseMapper.selectDcBusiMonthPlanBillMasterList(dcBusiMonthPlanBillMaster);
}
/**
* 新增月计划单据
*
* @param dcBusiMonthPlanBillMaster 月计划单据
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
public int insertDcBusiMonthPlanBillMaster(DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster)
{
DcBusiMonthPlanBillMaster params = new DcBusiMonthPlanBillMaster();
List<DcBusiMonthPlanBillMaster> dcBusiMonthPlanBillMasters = baseMapper.selectDcBusiMonthPlanBillMasterList(params);
if (!CollectionUtils.isEmpty(dcBusiMonthPlanBillMasters)) {
throw new RuntimeException("单据号已存在,请重新获取");
}
// 查询公司
SysDept company = sysDeptService.selectDeptById(dcBusiMonthPlanBillMaster.getCompanyId());
if (ObjectUtils.isNotEmpty(company)) {
dcBusiMonthPlanBillMaster.setCompanyName(company.getDeptName());
}
// 查询组织
SysDept organize = sysDeptService.selectDeptById(dcBusiMonthPlanBillMaster.getOragnizeId());
if (ObjectUtils.isNotEmpty(organize)) {
dcBusiMonthPlanBillMaster.setOrganizeName(organize.getDeptName());
}
this.insertSub(dcBusiMonthPlanBillMaster);
dcBusiMonthPlanBillMaster.setCreatedTime(DateUtils.getNowDate());
dcBusiMonthPlanBillMaster.setCreatedBy(SecurityUtils.getLoginUser().getUsername());
return baseMapper.insertDcBusiMonthPlanBillMaster(dcBusiMonthPlanBillMaster);
}
private void insertSub(DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster) {
List<DcBusiMonthPlanBillSub> subList = dcBusiMonthPlanBillMaster.getSubList();
if (!CollectionUtils.isEmpty(subList)) {
subList.forEach(item -> {
item.setBillNo(dcBusiMonthPlanBillMaster.getBillNo());
dcBusiMonthPlanBillSubMapper.insertDcBusiMonthPlanBillSub(item);
});
}
}
/**
* 修改月计划单据
*
* @param dcBusiMonthPlanBillMaster 月计划单据
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
public int updateDcBusiMonthPlanBillMaster(DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster)
{
dcBusiMonthPlanBillSubMapper.deleteDcBusiMonthPlanBillSubByBillNo(dcBusiMonthPlanBillMaster.getBillNo());
this.insertSub(dcBusiMonthPlanBillMaster);
dcBusiMonthPlanBillMaster.setUpdatedTime(DateUtils.getNowDate());
dcBusiMonthPlanBillMaster.setUpdatedBy(SecurityUtils.getLoginUser().getUsername());
return baseMapper.updateDcBusiMonthPlanBillMaster(dcBusiMonthPlanBillMaster);
}
/**
* 批量删除月计划单据
*
* @param ids 需要删除的月计划单据主键
* @return 结果
*/
public int deleteDcBusiMonthPlanBillMasterByIds(Long[] ids)
{
int count = 0;
for (int i = 0, len = ids.length; i < len; i++) {
count += this.deleteDcBusiMonthPlanBillMasterById(ids[i]);
}
return count;
}
/**
* 删除月计划单据信息
*
* @param id 月计划单据主键
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
public int deleteDcBusiMonthPlanBillMasterById(Long id)
{
DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster = baseMapper.selectDcBusiMonthPlanBillMasterById(id);
dcBusiMonthPlanBillSubMapper.deleteDcBusiMonthPlanBillSubByBillNo(dcBusiMonthPlanBillMaster.getBillNo());
return baseMapper.deleteDcBusiMonthPlanBillMasterById(id);
}
public int checkBack(String billNo) {
DcBusiMonthPlanBillMaster master = new DcBusiMonthPlanBillMaster();
master.setBillNo(billNo);
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setCheckStatus("0");
return baseMapper.updateDcBusiMonthPlanBillMasterByBillNo(master);
}
public int checkPass(String billNo) {
// 查询主表数据
DcBusiMonthPlanBillMaster master = baseMapper.selectDcBusiMonthPlanBillMasterByBillNo(billNo);
if ("0".equals(master.getCheckStatus())) {
throw new RuntimeException("审核失败,单据未提交");
}
if ("2".equals(master.getCheckStatus())) {
throw new RuntimeException("审核失败,单据已审核");
}
// 查询子表数据
DcBusiMonthPlanBillSub subParams = new DcBusiMonthPlanBillSub();
subParams.setBillNo(billNo);
List<DcBusiMonthPlanBillSub> subList = dcBusiMonthPlanBillSubMapper.selectDcBusiMonthPlanBillSubList(subParams);
DcBusiTargetDraftMonth dcBusiTargetDraftMonth;
if (!CollectionUtils.isEmpty(subList)) {
// 循环修改底稿表数据
for (int i = 0, len = subList.size(); i < len; i++) {
dcBusiTargetDraftMonth = new DcBusiTargetDraftMonth();
dcBusiTargetDraftMonth.setCompanyId(master.getCompanyId());
dcBusiTargetDraftMonth.setOrgId(master.getOragnizeId());
dcBusiTargetDraftMonth.setFieldCode(subList.get(i).getFieldCode());
dcBusiTargetDraftMonth.setAssetCode(subList.get(i).getAssetCode());
dcBusiTargetDraftMonth.setTargetCode(subList.get(i).getTargetCode());
dcBusiTargetDraftMonth.setCountYear(subList.get(i).getDateYear());
dcBusiTargetDraftMonth.setCountMonth(subList.get(i).getDateMonth());
List<DcBusiTargetDraftMonth> dcBusiTargetDraftDaynews = dcBusiTargetDraftMonthMapper.selectDcBusiTargetDraftMonthList(dcBusiTargetDraftMonth);
// 如果底稿表数据为空,则新增底稿数据,否则,加上计划值修改
if (CollectionUtils.isEmpty(dcBusiTargetDraftDaynews)) {
dcBusiTargetDraftMonth.setCompanyName(master.getCompanyName());
dcBusiTargetDraftMonth.setOrgName(master.getOrganizeName());
dcBusiTargetDraftMonth.setFieldName(subList.get(i).getFieldName());
dcBusiTargetDraftMonth.setAssetName(subList.get(i).getAssetName());
dcBusiTargetDraftMonth.setTargetName(subList.get(i).getTargetName());
DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(subList.get(i).getTargetCode(), subList.get(i).getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTarget)) {
dcBusiTargetDraftMonth.setTargetModelCode(dcBaseAssetTarget.getTargetModelCode());
dcBusiTargetDraftMonth.setTargetUint(dcBaseAssetTarget.getFieldUnit());
dcBusiTargetDraftMonth.setTargetNameAlias(dcBaseAssetTarget.getTargetNameAlias());
}
dcBusiTargetDraftMonth.setCountDate(subList.get(i).getDateYear() + "-" + subList.get(i).getDateMonth());
dcBusiTargetDraftMonth.setValPlan(subList.get(i).getPlanValue());
dcBusiTargetDraftMonthMapper.insertDcBusiTargetDraftMonth(dcBusiTargetDraftMonth);
} else {
dcBusiTargetDraftMonth = dcBusiTargetDraftDaynews.get(0);
dcBusiTargetDraftMonth.setValPlan(dcBusiTargetDraftMonth.getValPlan().add(subList.get(i).getPlanValue()));
dcBusiTargetDraftMonthMapper.updateDcBusiTargetDraftMonth(dcBusiTargetDraftMonth);
}
}
}
// 修改计划单状态为2
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setBillNo(billNo);
master.setCheckStatus("2");
return baseMapper.updateDcBusiMonthPlanBillMaster(master);
}
public int checkRevert(String billNo) {
// 查询主表
DcBusiMonthPlanBillMaster master = baseMapper.selectDcBusiMonthPlanBillMasterByBillNo(billNo);
if ("0".equals(master.getCheckStatus())) {
throw new RuntimeException("反审核失败,单据未提交");
}
if ("1".equals(master.getCheckStatus())) {
throw new RuntimeException("反审核失败,单据未审核通过");
}
// 如果单据状态为已审核状态,需要把底稿表数据恢复
if ("2".equals(master.getCheckStatus())) {
// 查询子表数据
DcBusiMonthPlanBillSub subParams = new DcBusiMonthPlanBillSub();
subParams.setBillNo(billNo);
List<DcBusiMonthPlanBillSub> subList = dcBusiMonthPlanBillSubMapper.selectDcBusiMonthPlanBillSubList(subParams);
DcBusiTargetDraftMonth dcBusiTargetDraftMonth;
for (int i = 0, len = subList.size(); i < len; i++) {
dcBusiTargetDraftMonth = new DcBusiTargetDraftMonth();
dcBusiTargetDraftMonth.setCompanyId(master.getCompanyId());
dcBusiTargetDraftMonth.setOrgId(master.getOragnizeId());
dcBusiTargetDraftMonth.setFieldCode(subList.get(i).getFieldCode());
dcBusiTargetDraftMonth.setAssetCode(subList.get(i).getAssetCode());
dcBusiTargetDraftMonth.setTargetCode(subList.get(i).getTargetCode());
dcBusiTargetDraftMonth.setCountYear(subList.get(i).getDateYear());
dcBusiTargetDraftMonth.setCountMonth(subList.get(i).getDateMonth());
List<DcBusiTargetDraftMonth> dcBusiTargetDraftMonthList = dcBusiTargetDraftMonthMapper.selectDcBusiTargetDraftMonthList(dcBusiTargetDraftMonth);
// 如果底稿表数据不为空,则减去计划值
if (!CollectionUtils.isEmpty(dcBusiTargetDraftMonthList)) {
dcBusiTargetDraftMonth = dcBusiTargetDraftMonthList.get(0);
dcBusiTargetDraftMonth.setValPlan(dcBusiTargetDraftMonth.getValPlan().subtract(subList.get(i).getPlanValue()));
dcBusiTargetDraftMonthMapper.updateDcBusiTargetDraftMonth(dcBusiTargetDraftMonth);
}
}
}
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setBillNo(billNo);
master.setCheckStatus("0");
return baseMapper.updateDcBusiMonthPlanBillMaster(master);
}
}

91
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiMonthPlanBillSubService.java

@ -0,0 +1,91 @@
package com.lzbi.bill.service;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.lzbi.bill.domain.DcBusiMonthPlanBillSub;
import com.lzbi.bill.mapper.DcBusiMonthPlanBillSubMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 月计划单据明细Service业务层处理
*
* @author lienbo
* @date 2023-12-26
*/
@Service
public class DcBusiMonthPlanBillSubService extends ServiceImpl<DcBusiMonthPlanBillSubMapper, DcBusiMonthPlanBillSub> implements IService<DcBusiMonthPlanBillSub>
{
/**
* 查询月计划单据明细
*
* @param id 月计划单据明细主键
* @return 月计划单据明细
*/
public DcBusiMonthPlanBillSub selectDcBusiMonthPlanBillSubById(Long id)
{
return baseMapper.selectDcBusiMonthPlanBillSubById(id);
}
/**
* 查询月计划单据明细列表
*
* @param dcBusiMonthPlanBillSub 月计划单据明细
* @return 月计划单据明细
*/
public List<DcBusiMonthPlanBillSub> selectDcBusiMonthPlanBillSubList(DcBusiMonthPlanBillSub dcBusiMonthPlanBillSub)
{
return baseMapper.selectDcBusiMonthPlanBillSubList(dcBusiMonthPlanBillSub);
}
/**
* 新增月计划单据明细
*
* @param dcBusiMonthPlanBillSub 月计划单据明细
* @return 结果
*/
public int insertDcBusiMonthPlanBillSub(DcBusiMonthPlanBillSub dcBusiMonthPlanBillSub)
{
dcBusiMonthPlanBillSub.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiMonthPlanBillSub(dcBusiMonthPlanBillSub);
}
/**
* 修改月计划单据明细
*
* @param dcBusiMonthPlanBillSub 月计划单据明细
* @return 结果
*/
public int updateDcBusiMonthPlanBillSub(DcBusiMonthPlanBillSub dcBusiMonthPlanBillSub)
{
dcBusiMonthPlanBillSub.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiMonthPlanBillSub(dcBusiMonthPlanBillSub);
}
/**
* 批量删除月计划单据明细
*
* @param ids 需要删除的月计划单据明细主键
* @return 结果
*/
public int deleteDcBusiMonthPlanBillSubByIds(Long[] ids)
{
return baseMapper.deleteDcBusiMonthPlanBillSubByIds(ids);
}
/**
* 删除月计划单据明细信息
*
* @param id 月计划单据明细主键
* @return 结果
*/
public int deleteDcBusiMonthPlanBillSubById(Long id)
{
return baseMapper.deleteDcBusiMonthPlanBillSubById(id);
}
}

2
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java

@ -9,7 +9,7 @@ import com.lzbi.module.base.BaseModuleEntity;
import lombok.experimental.Accessors;
/**
* 指标数据底稿()对象 dc_busi_target_draft_month
* 指标数据底稿()对象 dc_busi_target_draft_day
*
* @author zhousq
* @date 2023-12-06

2
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java

@ -93,7 +93,7 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity
/** 计划值 */
@Excel(name = "计划值")
private String valPlan;
private BigDecimal valPlan;
private String targetModelCode;

155
lzbi-module/src/main/resources/mapper/asset/DcBusiMonthPlanBillMasterMapper.xml

@ -0,0 +1,155 @@
<?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.bill.mapper.DcBusiMonthPlanBillMasterMapper">
<resultMap type="com.lzbi.bill.domain.DcBusiMonthPlanBillMaster" id="DcBusiMonthPlanBillMasterResult">
<result property="id" column="id" />
<result property="billNo" column="bill_no" />
<result property="billIncomeDate" column="bill_income_date" />
<result property="billType" column="bill_type" />
<result property="checkType" column="check_type" />
<result property="checkStatus" column="check_status" />
<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="companyId" column="company_id" />
<result property="companyName" column="company_name" />
<result property="organizeName" column="organize_name" />
<result property="oragnizeId" column="oragnize_id" />
</resultMap>
<sql id="selectDcBusiMonthPlanBillMasterVo">
select id, bill_no, bill_income_date, bill_type, check_type, check_status, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, company_id, company_name, organize_name, oragnize_id from dc_busi_month_plan_bill_master
</sql>
<select id="selectDcBusiMonthPlanBillMasterList" parameterType="DcBusiMonthPlanBillMaster" resultMap="DcBusiMonthPlanBillMasterResult">
<include refid="selectDcBusiMonthPlanBillMasterVo"/>
<where>
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
<if test="billIncomeDate != null and billIncomeDate != ''"> and bill_income_date = #{billIncomeDate}</if>
<if test="billType != null and billType != ''"> and bill_type = #{billType}</if>
<if test="checkType != null and checkType != ''"> and check_type = #{checkType}</if>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="organizeName != null and organizeName != ''"> and organize_name like concat('%', #{organizeName}, '%')</if>
<if test="oragnizeId != null "> and oragnize_id = #{oragnizeId}</if>
</where>
</select>
<select id="selectDcBusiMonthPlanBillMasterById" parameterType="Long" resultMap="DcBusiMonthPlanBillMasterResult">
<include refid="selectDcBusiMonthPlanBillMasterVo"/>
where id = #{id}
</select>
<select id="selectDcBusiMonthPlanBillMasterByBillNo" parameterType="String"
resultType="com.lzbi.bill.domain.DcBusiMonthPlanBillMaster">
<include refid="selectDcBusiMonthPlanBillMasterVo"/>
where bill_no = #{billNo}
</select>
<insert id="insertDcBusiMonthPlanBillMaster" parameterType="DcBusiMonthPlanBillMaster" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_month_plan_bill_master
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billNo != null">bill_no,</if>
<if test="billIncomeDate != null">bill_income_date,</if>
<if test="billType != null">bill_type,</if>
<if test="checkType != null">check_type,</if>
<if test="checkStatus != null">check_status,</if>
<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="companyId != null">company_id,</if>
<if test="companyName != null">company_name,</if>
<if test="organizeName != null">organize_name,</if>
<if test="oragnizeId != null">oragnize_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billNo != null">#{billNo},</if>
<if test="billIncomeDate != null">#{billIncomeDate},</if>
<if test="billType != null">#{billType},</if>
<if test="checkType != null">#{checkType},</if>
<if test="checkStatus != null">#{checkStatus},</if>
<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="companyId != null">#{companyId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="organizeName != null">#{organizeName},</if>
<if test="oragnizeId != null">#{oragnizeId},</if>
</trim>
</insert>
<update id="updateDcBusiMonthPlanBillMaster" parameterType="DcBusiMonthPlanBillMaster">
update dc_busi_month_plan_bill_master
<trim prefix="SET" suffixOverrides=",">
<if test="billNo != null">bill_no = #{billNo},</if>
<if test="billIncomeDate != null">bill_income_date = #{billIncomeDate},</if>
<if test="billType != null">bill_type = #{billType},</if>
<if test="checkType != null">check_type = #{checkType},</if>
<if test="checkStatus != null">check_status = #{checkStatus},</if>
<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="companyId != null">company_id = #{companyId},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="organizeName != null">organize_name = #{organizeName},</if>
<if test="oragnizeId != null">oragnize_id = #{oragnizeId},</if>
</trim>
where id = #{id}
</update>
<update id="updateDcBusiMonthPlanBillMasterByBillNo" parameterType="DcBusiMonthPlanBillMaster">
update dc_busi_month_plan_bill_master
<trim prefix="SET" suffixOverrides=",">
<if test="billIncomeDate != null">bill_income_date = #{billIncomeDate},</if>
<if test="billType != null">bill_type = #{billType},</if>
<if test="checkType != null">check_type = #{checkType},</if>
<if test="checkStatus != null">check_status = #{checkStatus},</if>
<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="companyId != null">company_id = #{companyId},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="organizeName != null">organize_name = #{organizeName},</if>
<if test="oragnizeId != null">oragnize_id = #{oragnizeId},</if>
</trim>
where bill_no = #{billNo}
</update>
<delete id="deleteDcBusiMonthPlanBillMasterById" parameterType="Long">
delete from dc_busi_month_plan_bill_master where id = #{id}
</delete>
<delete id="deleteDcBusiMonthPlanBillMasterByIds" parameterType="String">
delete from dc_busi_month_plan_bill_master where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

136
lzbi-module/src/main/resources/mapper/asset/DcBusiMonthPlanBillSubMapper.xml

@ -0,0 +1,136 @@
<?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.bill.mapper.DcBusiMonthPlanBillSubMapper">
<resultMap type="com.lzbi.bill.domain.DcBusiMonthPlanBillSub" id="DcBusiMonthPlanBillSubResult">
<result property="id" column="id" />
<result property="billNo" column="bill_no" />
<result property="fieldCode" column="field_code" />
<result property="fieldName" column="field_name" />
<result property="assetCode" column="asset_code" />
<result property="assetName" column="asset_name" />
<result property="targetCode" column="target_code" />
<result property="targetName" column="target_name" />
<result property="planValue" column="plan_value" />
<result property="dateYear" column="date_year" />
<result property="dateMonth" column="date_month" />
<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" />
</resultMap>
<sql id="selectDcBusiMonthPlanBillSubVo">
select id, bill_no, field_code, field_name, asset_code, asset_name, target_code, target_name, plan_value, date_year, date_month, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_month_plan_bill_sub
</sql>
<select id="selectDcBusiMonthPlanBillSubList" parameterType="DcBusiMonthPlanBillSub" resultMap="DcBusiMonthPlanBillSubResult">
<include refid="selectDcBusiMonthPlanBillSubVo"/>
<where>
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if>
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if>
<if test="assetName != null and assetName != ''"> and asset_name like concat('%', #{assetName}, '%')</if>
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if>
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if>
<if test="planValue != null "> and plan_value = #{planValue}</if>
<if test="dateYear != null and dateYear != ''"> and date_year = #{dateYear}</if>
<if test="dateMonth != null and dateMonth != ''"> and date_month = #{dateMonth}</if>
</where>
</select>
<select id="selectDcBusiMonthPlanBillSubById" parameterType="Long" resultMap="DcBusiMonthPlanBillSubResult">
<include refid="selectDcBusiMonthPlanBillSubVo"/>
where id = #{id}
</select>
<insert id="insertDcBusiMonthPlanBillSub" parameterType="DcBusiMonthPlanBillSub" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_month_plan_bill_sub
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billNo != null">bill_no,</if>
<if test="fieldCode != null">field_code,</if>
<if test="fieldName != null">field_name,</if>
<if test="assetCode != null">asset_code,</if>
<if test="assetName != null">asset_name,</if>
<if test="targetCode != null">target_code,</if>
<if test="targetName != null">target_name,</if>
<if test="planValue != null">plan_value,</if>
<if test="dateYear != null">date_year,</if>
<if test="dateMonth != null">date_month,</if>
<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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billNo != null">#{billNo},</if>
<if test="fieldCode != null">#{fieldCode},</if>
<if test="fieldName != null">#{fieldName},</if>
<if test="assetCode != null">#{assetCode},</if>
<if test="assetName != null">#{assetName},</if>
<if test="targetCode != null">#{targetCode},</if>
<if test="targetName != null">#{targetName},</if>
<if test="planValue != null">#{planValue},</if>
<if test="dateYear != null">#{dateYear},</if>
<if test="dateMonth != null">#{dateMonth},</if>
<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>
</trim>
</insert>
<update id="updateDcBusiMonthPlanBillSub" parameterType="DcBusiMonthPlanBillSub">
update dc_busi_month_plan_bill_sub
<trim prefix="SET" suffixOverrides=",">
<if test="billNo != null">bill_no = #{billNo},</if>
<if test="fieldCode != null">field_code = #{fieldCode},</if>
<if test="fieldName != null">field_name = #{fieldName},</if>
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetName != null">asset_name = #{assetName},</if>
<if test="targetCode != null">target_code = #{targetCode},</if>
<if test="targetName != null">target_name = #{targetName},</if>
<if test="planValue != null">plan_value = #{planValue},</if>
<if test="dateYear != null">date_year = #{dateYear},</if>
<if test="dateMonth != null">date_month = #{dateMonth},</if>
<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>
</trim>
where id = #{id}
</update>
<delete id="deleteDcBusiMonthPlanBillSubById" parameterType="Long">
delete from dc_busi_month_plan_bill_sub where id = #{id}
</delete>
<delete id="deleteDcBusiMonthPlanBillSubByIds" parameterType="String">
delete from dc_busi_month_plan_bill_sub where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteDcBusiMonthPlanBillSubByBillNo" parameterType="java.lang.String">
delete from dc_busi_month_plan_bill_sub where bill_no = #{billNo}
</delete>
</mapper>

13
lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml

@ -35,11 +35,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDcBusiTargetDraftMonthVo">
select id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_code, field_name, target_name_alias, target_name, target_code, target_uint, count_date, count_year, count_month val_original, val_adjust, val_result, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_target_draft_month
select id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_code, field_name, target_name_alias, target_name, target_code, target_uint, count_date, count_year, count_month, val_original, val_adjust, val_result, val_plan, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_target_draft_month
</sql>
<select id="selectDcBusiTargetDraftMonthList" parameterType="DcBusiTargetDraftMonth" resultMap="DcBusiTargetDraftMonthResult">
select t.id, t.company_name, t.company_id, t.org_id, t.org_name, t.asset_code, t.asset_name, t.field_code, t.field_name, t.target_name_alias, t.target_name, t.target_code, t.target_uint, t.count_date, t.count_year, t.count_month, t.val_original, t.val_adjust, t.val_result
select t.id, t.company_name, t.company_id, t.org_id, t.org_name, t.asset_code, t.asset_name, t.field_code, t.field_name, t.target_name_alias, t.target_name, t.target_code, t.target_uint, t.count_date, t.count_year, t.count_month, t.val_original, t.val_adjust, t.val_result, t.val_plan, t.tenant_id, t.revision, t.created_by, t.created_time, t.updated_by, t.updated_time, t.delete_by, t.delete_time
from dc_busi_target_draft_month t
<if test="targetModelCode != null and targetModelCode != ''">
inner join dc_base_asset_target t1 on t.target_code = t1.target_code and t.asset_code = t1.asset_code and t1.target_model_code = #{targetModelCode}
@ -78,9 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="targetCode != null">target_code,</if>
<if test="targetUint != null">target_uint,</if>
<if test="countDate != null">count_date,</if>
<if test="countYear != null">count_year,</if>
<if test="countMonth != null">count_month,</if>
<if test="valOriginal != null">val_original,</if>
<if test="valAdjust != null">val_adjust,</if>
<if test="valResult != null">val_result,</if>
<if test="valPlan != null">val_plan,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</if>
@ -104,9 +107,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="targetCode != null">#{targetCode},</if>
<if test="targetUint != null">#{targetUint},</if>
<if test="countDate != null">#{countDate},</if>
<if test="countYear != null">#{countYear},</if>
<if test="countMonth != null">#{countMonth},</if>
<if test="valOriginal != null">#{valOriginal},</if>
<if test="valAdjust != null">#{valAdjust},</if>
<if test="valResult != null">#{valResult},</if>
<if test="valPlan != null">#{valPlan},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
@ -134,9 +140,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="targetCode != null">target_code = #{targetCode},</if>
<if test="targetUint != null">target_uint = #{targetUint},</if>
<if test="countDate != null">count_date = #{countDate},</if>
<if test="countYear != null">count_year = #{countYear},</if>
<if test="countMonth != null">count_month = #{countMonth},</if>
<if test="valOriginal != null">val_original = #{valOriginal},</if>
<if test="valAdjust != null">val_adjust = #{valAdjust},</if>
<if test="valResult != null">val_result = #{valResult},</if>
<if test="valPlan != null">val_plan = #{valPlan},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>

Loading…
Cancel
Save