Browse Source

2023-12-14 指标采集单录入,修改编码规则的序号生成不同步bug;修复发现的其他bug

develop
zhousq 11 months ago
parent
commit
bd66d76c50
  1. 2
      lzbi-module/src/main/java/com/lzbi/code/mapper/DcBaseCoderuleDefineMapper.java
  2. 10
      lzbi-module/src/main/java/com/lzbi/code/service/DcBaseCoderuleDefineService.java
  3. 2
      lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java
  4. 29
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java
  5. 131
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetBillMasterController.java
  6. 255
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetCollectBill.java
  7. 26
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiBillModelMaster.java
  8. 1
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillMaster.java
  9. 100
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetBillMaster.java
  10. 95
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetBillSub.java
  11. 21
      lzbi-module/src/main/java/com/lzbi/draft/domain/DeptQueryParams.java
  12. 90
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetBillMasterMapper.java
  13. 133
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetBillMasterService.java
  14. 14
      lzbi-module/src/main/resources/mapper/asset/DcBaseCoderuleDefineMapper.xml
  15. 9
      lzbi-module/src/main/resources/mapper/draft/DcBusiBillModelMasterMapper.xml
  16. 181
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetBillMasterMapper.xml

2
lzbi-module/src/main/java/com/lzbi/code/mapper/DcBaseCoderuleDefineMapper.java

@ -39,6 +39,7 @@ public interface DcBaseCoderuleDefineMapper extends BaseMapper<DcBaseCoderuleDef
*/
public int insertDcBaseCoderuleDefineDao(DcBaseCoderuleDefineDao dcBaseCoderuleDefineDao);
public int insertSerial(Long ruleId);
public int deleteSerialByRuleId(Long ruleId);
/**
* 修改编码规则定义
@ -63,6 +64,7 @@ public interface DcBaseCoderuleDefineMapper extends BaseMapper<DcBaseCoderuleDef
* @return 结果
*/
public int deleteDcBaseCoderuleDefineDaoByIds(Long[] ids);
public int deleteDcBaseCoderuleserialByIds(Long[] ids);
public DcBaseCoderuleSerialDao getSerialByRuleId(Long rid);
public int updateSerial(long revision ,long serial,long id);

10
lzbi-module/src/main/java/com/lzbi/code/service/DcBaseCoderuleDefineService.java

@ -15,6 +15,8 @@ import com.lzbi.code.domain.DcBaseCoderuleDefineDao;
import com.lzbi.code.mapper.DcBaseCoderuleDefineMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
/**
* 编码规则定义Service业务层处理
*
@ -53,7 +55,7 @@ public class DcBaseCoderuleDefineService extends ServiceImpl<DcBaseCoderuleDefin
* @param dcBaseCoderuleDefineDao 编码规则定义
* @return 结果
*/
@Transactional
public int insertDcBaseCoderuleDefineDao(DcBaseCoderuleDefineDao dcBaseCoderuleDefineDao)
{
dcBaseCoderuleDefineDao.setCreatedTime(DateUtils.getNowDate());
@ -84,10 +86,12 @@ public class DcBaseCoderuleDefineService extends ServiceImpl<DcBaseCoderuleDefin
* @param ids 需要删除的编码规则定义主键
* @return 结果
*/
@Transactional
public int deleteDcBaseCoderuleDefineDaoByIds(Long[] ids)
{
return baseMapper.deleteDcBaseCoderuleDefineDaoByIds(ids);
int ret =baseMapper.deleteDcBaseCoderuleDefineDaoByIds(ids);
baseMapper.deleteDcBaseCoderuleserialByIds(ids);;
return ret;
}
/**

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

@ -116,7 +116,7 @@ public class SelectOptionsControl extends BaseController {
{
DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao();
dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode());
dcBaseAssetTargetDao.setColumnType(null);
dcBaseAssetTargetDao.setColumnType("T");
//dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId());
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao));
}

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

@ -17,10 +17,7 @@ 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.domain.*;
import com.lzbi.draft.service.DcBusiBillModelMasterService;
import com.lzbi.draft.service.DcBusiParamBillMasterService;
import com.lzbi.system.service.ISysDeptService;
@ -85,12 +82,35 @@ public class DcBusiParamCollectBill extends BaseController
LoginUser loginUser = SecurityUtils.getLoginUser();
dcBusiBillModelMaster.setCreatedBy(loginUser.getUsername());
dcBusiBillModelMaster.setCompanyId(Optional.ofNullable(companyId).orElse(null));
dcBusiBillModelMaster.setModelType("P");
//dcBusiBillModelMaster.setDeptId(loginUser.getDeptId());
//dcBusiBillModelMaster.setRoleId(loginUser.getUser().getRoleId());
startPage();
List<DcBusiBillModelMaster> list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(dcBusiBillModelMaster);
return getDataTable(list);
}
@GetMapping("/userModellist")
public TableDataInfo getUserModellist(DeptQueryParams deptQueryParams)
{ startPage();
List<DcBusiBillModelMaster> list;
if(StringUtils.isNotNull(deptQueryParams)){
DcBusiBillModelMaster dcBusiBillModelMaster=new DcBusiBillModelMaster();
LoginUser loginUser = SecurityUtils.getLoginUser();
dcBusiBillModelMaster.setCreatedBy(loginUser.getUsername());
dcBusiBillModelMaster.setModelType("P");
if(Optional.ofNullable(deptQueryParams.getOrgType()).orElse("").equals("1002")){
dcBusiBillModelMaster.setCompanyId(Optional.ofNullable(deptQueryParams.getDeptId()).orElse(0L));
}else{
dcBusiBillModelMaster.setOrgId(Optional.ofNullable(deptQueryParams.getDeptId()).orElse(0L));
}
list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(dcBusiBillModelMaster);
}else{
list=new ArrayList<>();
}
return getDataTable(list);
}
@GetMapping("/userModelById/{mid}")
public AjaxResult getUserModelById(@PathVariable Long mid)
{
@ -141,6 +161,7 @@ public class DcBusiParamCollectBill extends BaseController
dcBusiBillModelMaster.setBillModelPoint(dcBusiParamBillMaster.getCountTimes());
dcBusiBillModelMaster.setRoleId(loginUser.getUser().getRoleId());
dcBusiBillModelMaster.setDeptId(loginUser.getDeptId());
dcBusiBillModelMaster.setModelType("P");
long deptId=dcBusiParamBillMaster.getCompanyId();
SysDept sysDept = Optional.ofNullable(sysDeptService.selectDeptById(deptId)).orElse(new SysDept()) ;
dcBusiBillModelMaster.setCompanyId(deptId);

131
lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetBillMasterController.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. DcBusiTargetBillMaster;
import com.lzbi.draft.service.DcBusiTargetBillMasterService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
/**
* 统计指标录入Controller
*
* @author zhousq
* @date 2023-12-14
*/
@RestController
@RequestMapping("/draft/targetBillMaster")
public class DcBusiTargetBillMasterController extends BaseController
{
@Autowired
private DcBusiTargetBillMasterService dcBusiTargetBillMasterService;
/**
* 查询统计指标录入列表
*/
@ApiOperation("查询统计指标录入列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetBillMaster", value = "", dataType = "DcBusiTargetBillMaster", dataTypeClass = DcBusiTargetBillMaster.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetCollect:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiTargetBillMaster DcBusiTargetBillMaster)
{
startPage();
List< DcBusiTargetBillMaster> list = dcBusiTargetBillMasterService.selectDcBusiTargetBillMasterList(DcBusiTargetBillMaster);
return getDataTable(list);
}
/**
* 导出统计指标录入列表
*/
@ApiOperation("导出统计指标录入列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetBillMaster", value = "", dataType = "DcBusiTargetBillMaster", dataTypeClass = DcBusiTargetBillMaster.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetCollect:export')")
@Log(title = "统计指标录入", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response,DcBusiTargetBillMaster DcBusiTargetBillMaster)
{
List<DcBusiTargetBillMaster> list = dcBusiTargetBillMasterService.selectDcBusiTargetBillMasterList(DcBusiTargetBillMaster);
ExcelUtil<DcBusiTargetBillMaster> util = new ExcelUtil<DcBusiTargetBillMaster>(DcBusiTargetBillMaster.class);
util.exportExcel(response, list, "统计指标录入数据");
}
/**
* 获取统计指标录入详细信息
*/
@ApiOperation("获取统计指标录入详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetCollect:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiTargetBillMasterService.selectDcBusiTargetBillMasterById(id));
}
/**
* 新增统计指标录入
*/
@ApiOperation("新增统计指标录入")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetBillMaster", value = "", dataType = "DcBusiTargetBillMaster", dataTypeClass = DcBusiTargetBillMaster.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetCollect:add')")
@Log(title = "统计指标录入", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiTargetBillMaster DcBusiTargetBillMaster)
{
return toAjax(dcBusiTargetBillMasterService.insertDcBusiTargetBillMaster(DcBusiTargetBillMaster));
}
/**
* 修改统计指标录入
*/
@ApiOperation("修改统计指标录入")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetBillMaster", value = "", dataType = "DcBusiTargetBillMaster", dataTypeClass = DcBusiTargetBillMaster.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetCollect:edit')")
@Log(title = "统计指标录入", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiTargetBillMaster DcBusiTargetBillMaster)
{
return toAjax(dcBusiTargetBillMasterService.updateDcBusiTargetBillMaster(DcBusiTargetBillMaster));
}
/**
* 删除统计指标录入
*/
@ApiOperation("删除统计指标录入")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetCollect:remove')")
@Log(title = "统计指标录入", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiTargetBillMasterService.deleteDcBusiTargetBillMasterByIds(ids));
}
}

255
lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetCollectBill.java

@ -0,0 +1,255 @@
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.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.core.domain.entity.SysDept;
import com.lzbi.common.core.domain.model.LoginUser;
import com.lzbi.common.core.page.TableDataInfo;
import com.lzbi.common.utils.SecurityUtils;
import com.lzbi.common.utils.StringUtils;
import com.lzbi.draft.domain.*;
import com.lzbi.draft.service.DcBusiBillModelMasterService;
import com.lzbi.draft.service.DcBusiTargetBillMasterService;
import com.lzbi.system.service.ISysDeptService;
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.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
* 参数采集录入单据主Controller
*
* @author win
* @date 2023-11-28
*/
@RestController
@RequestMapping("/draft/targetCollect")
public class DcBusiTargetCollectBill extends BaseController
{
@Autowired
private DcBusiBillModelMasterService dcBusiBillModelMasterService;
@Autowired
private DcBusiTargetBillMasterService dcBusiTargetBillMasterService;
@Autowired
private DcBaseCoderuleDefineService dcBaseCoderuleDefineService;
@Autowired
private CodeNoGenerater codeNoGenerater;
@Autowired
private ISysDeptService sysDeptService;
/**
* 查询参数采集录入
* 根据
*/
// @PreAuthorize("@ss.hasPermi('param:paramData:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiTargetBillMaster dcBusiTargetBillMasterDao)
{
startPage();
//List<DcBusiTargetBillMaster> list = dcBusiTargetBillMasterService.selectDcBusiTargetBillMasterDaoList(dcBusiTargetBillMasterDao);
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.setModelType("T");
//dcBusiBillModelMaster.setDeptId(loginUser.getDeptId());
//dcBusiBillModelMaster.setRoleId(loginUser.getUser().getRoleId());
startPage();
List<DcBusiBillModelMaster> list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(dcBusiBillModelMaster);
return getDataTable(list);
}
@GetMapping("/userModellist")
public TableDataInfo getUserModellist(DeptQueryParams deptQueryParams)
{ startPage();
List<DcBusiBillModelMaster> list;
if(StringUtils.isNotNull(deptQueryParams)){
DcBusiBillModelMaster dcBusiBillModelMaster=new DcBusiBillModelMaster();
LoginUser loginUser = SecurityUtils.getLoginUser();
dcBusiBillModelMaster.setCreatedBy(loginUser.getUsername());
dcBusiBillModelMaster.setModelType("T");
if(Optional.ofNullable(deptQueryParams.getOrgType()).orElse("").equals("1002")){
dcBusiBillModelMaster.setCompanyId(Optional.ofNullable(deptQueryParams.getDeptId()).orElse(0L));
}else{
dcBusiBillModelMaster.setOrgId(Optional.ofNullable(deptQueryParams.getDeptId()).orElse(0L));
}
list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(dcBusiBillModelMaster);
}else{
list=new ArrayList<>();
}
return getDataTable(list);
}
@GetMapping("/userModelById/{mid}")
public AjaxResult getUserModelById(@PathVariable Long mid)
{
DcBusiBillModelMaster dcBusiBillModelMaster = dcBusiBillModelMasterService.selectDcBusiBillModelMasterById(mid);
return AjaxResult.success(dcBusiBillModelMaster);
}
/**
* 根据根据公司查询模版现根据角色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());
dcBusiBillModelMaster.setModelType("T");
startPage();
List<DcBusiBillModelMaster> list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(dcBusiBillModelMaster);
return getDataTable(list);
}
@ApiOperation("根据单据模版编号获取模版内容信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "modelNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@GetMapping("/getBillModelDetail/{modelNo}")
public AjaxResult getBillModelDetail(@PathVariable String modelNo){
List<DcBusiBillModelSub> list=new ArrayList<>();
return AjaxResult.success();
}
@ApiOperation("保存配置模版")
@ApiImplicitParams({
@ApiImplicitParam(name = "dcBusiTargetBillMaster", value = "", dataType = "DcBusiParamBillMaster", dataTypeClass = DcBusiTargetBillMaster.class),
})
@PostMapping("/saveBillModel")
public AjaxResult saveBillModel(@RequestBody DcBusiTargetBillMaster 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.setModelType("T");
long deptId=dcBusiParamBillMaster.getCompanyId();
SysDept sysDept = Optional.ofNullable(sysDeptService.selectDeptById(deptId)).orElse(new SysDept()) ;
dcBusiBillModelMaster.setCompanyId(deptId);
dcBusiBillModelMaster.setCompanyName(sysDept.getDeptName());
deptId=dcBusiParamBillMaster.getOragnizeId();
dcBusiBillModelMaster.setOrgId(deptId);
sysDept = Optional.ofNullable(sysDeptService.selectDeptById(deptId)).orElse(new SysDept()) ;
dcBusiBillModelMaster.setOrgName(sysDept.getDeptName());
dcBusiBillModelMaster.setDataState("0");
dcBusiBillModelMaster.setUseState("1");
dcBusiBillModelMaster.setFieldCode(dcBusiParamBillMaster.getFieldCode());
dcBusiBillModelMaster.setFieldName(dcBusiParamBillMaster.getFieldName());
dcBusiBillModelMaster.setBillModelNo(billModelNo);
dcBusiBillModelMaster.setBillModelName(dcBusiParamBillMaster.getBiilModelName());
List<DcBusiBillModelSub> dcBusiBillModelSubList=new ArrayList<>();
JSONArray jsonArray=Optional.ofNullable(JSONArray.from(dcBusiParamBillMaster.getSubDatas())).orElse(new JSONArray());
jsonArray.forEach(item -> {
JSONObject jsb = JSONObject.from(item);
DcBusiBillModelSub modelSub=new DcBusiBillModelSub();
modelSub.setBillModelNo(billModelNo);
modelSub.setAssetCode(jsb.getString("assetCode"));
modelSub.setAssetName(jsb.getString("assetName"));
//modelSub.setAssetId(item.get);
modelSub.setAssetUnitCode(jsb.getString("targetCode"));
modelSub.setAssetUnitName(jsb.getString("targetName"));
modelSub.setAssetUnitType("T");
modelSub.setAUnit(jsb.getString("targetUint"));
dcBusiBillModelSubList.add(modelSub);
});
dcBusiBillModelMaster.setDcBusiBillModelSubList(dcBusiBillModelSubList);
return AjaxResult.success(dcBusiBillModelMasterService.insertDcBusiBillModelMaster(dcBusiBillModelMaster));
}
@ApiOperation("保存参数采集数据-直接对象方式")
@ApiImplicitParams({
@ApiImplicitParam(name = "dcBusiParamBillMaster", value = "", dataType = "DcBusiParamBillMaster", dataTypeClass = DcBusiTargetBillMaster.class),
})
@PostMapping("/saveBillCollectObj")
public AjaxResult saveBillCollectByObj(@RequestBody DcBusiTargetBillMaster dcBusiTargetBillMaster){
dcBusiTargetBillMaster.setId(null);
return AjaxResult.success(dcBusiTargetBillMasterService.insertDcBusiTargetBillMaster(dcBusiTargetBillMaster));
}
@ApiOperation("保存参数采集数据-subDatas数组方式")
@ApiImplicitParams({
@ApiImplicitParam(name = "dcBusiTargetBillMaster", value = "", dataType = "DcBusiTargetBillMaster", dataTypeClass = DcBusiTargetBillMaster.class),
})
@PostMapping("/saveBillCollectArray")
/*subDatas为动态数据列,值是分开的索要对每个列值进行处理*/
public AjaxResult saveBillCollectBy(@RequestBody DcBusiTargetBillMaster dcBusiTargetBillMaster){
List<DcBusiTargetBillSub> dcBusiTargetBillSubList =new ArrayList<>();
String billNo=dcBusiTargetBillMaster.getBillNo();
String fieldCode=dcBusiTargetBillMaster.getFieldCode();
String fieldName=dcBusiTargetBillMaster.getFieldName();
String countDate=dcBusiTargetBillMaster.getCountDate();
dcBusiTargetBillMaster.setBillIncomeDate(countDate);
dcBusiTargetBillMaster.setCreatedBy(SecurityUtils.getLoginUser().getUsername());
JSONArray jsonArray=Optional.ofNullable(JSONArray.from(dcBusiTargetBillMaster.getSubDatas())).orElse(new JSONArray());
jsonArray.forEach(item->{
JSONObject jsb = JSONObject.from(item);
for(int i=1;i<31;i++){
String fname="val_"+String.valueOf(i);
Double value=jsb.getDouble(fname);
if(StringUtils.isNotNull(value)){
DcBusiTargetBillSub dcBusiTargetBillSub=new DcBusiTargetBillSub();
//基本数据
dcBusiTargetBillSub.setBillNo(billNo);
dcBusiTargetBillSub.setId(null);
dcBusiTargetBillSub.setTargetCode(jsb.getString("targetCode"));
dcBusiTargetBillSub.setAssetCode(jsb.getString("assetCode"));
dcBusiTargetBillSub.setAssetName(jsb.getString("assetName"));
//dcBusiTargetBillSub.setCountDate(jsb.getString("countDate"));
dcBusiTargetBillSub.setCountDate(countDate);
dcBusiTargetBillSub.setTargetUint(jsb.getString("targetUint"));
dcBusiTargetBillSub.setTargetName(jsb.getString("targetName"));
dcBusiTargetBillSub.setFieldCode(fieldCode);
dcBusiTargetBillSub.setFieldName(fieldName);
dcBusiTargetBillSub.setCountDay(i);
dcBusiTargetBillSub.setTargetValue(value);
dcBusiTargetBillSubList.add(dcBusiTargetBillSub);
}
}
});
dcBusiTargetBillMaster.setDcBusiTargetBillSubList(dcBusiTargetBillSubList);
return AjaxResult.success(dcBusiTargetBillMasterService.insertDcBusiTargetBillMaster(dcBusiTargetBillMaster));
}
private String getBillModelNo(){
DcBusiCoderuleConfigDao ruleIdByBusicode =Optional.ofNullable(dcBaseCoderuleDefineService.getRuleIdByBusicode("BILL_MODEL_NO")).orElse(new DcBusiCoderuleConfigDao()) ;
DcBaseCoderuleDefineDao ruleDao = dcBaseCoderuleDefineService.selectDcBaseCoderuleDefineDaoById(ruleIdByBusicode.getRuleId());
return codeNoGenerater.getCode(ruleDao);
}
}

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

@ -25,62 +25,76 @@ import com.lzbi.module.base.BaseModuleEntity;
public class DcBusiBillModelMaster extends BaseModuleEntity
{
/** 主键 */
@ApiModelProperty(name = "主键",notes = "")
@TableId(type= IdType.AUTO)
private Long id ;
// @ApiModelProperty(name = "主键",notes = "")
// @TableId(type= IdType.AUTO)
// private Long id ;
private static final long serialVersionUID = 1L;
/** 部门Id */
@Excel(name = "部门Id")
private Long deptId;
// @Excel(name = "部门Id")
// @ApiModelProperty(name = "模版类型",notes = "")
// private Long deptId;
/** 角色ID */
@Excel(name = "角色ID")
@ApiModelProperty(name = "角色ID",notes = "")
private Long roleId;
/** 任务模版编号 */
@Excel(name = "任务模版编号")
@ApiModelProperty(name = "任务模版编号",notes = "")
private String billModelNo;
/** 任务模版名称 */
@Excel(name = "任务模版名称")
@ApiModelProperty(name = "任务模版名称",notes = "")
private String billModelName;
/** 所属专业编码 */
@Excel(name = "所属专业编码")
@ApiModelProperty(name = "所属专业编码",notes = "")
private String fieldCode;
/** 所属公司名称 */
@Excel(name = "所属公司名称")
@ApiModelProperty(name = "所属公司名称",notes = "")
private String companyName;
/** 所属公司ID */
@Excel(name = "所属公司ID")
@ApiModelProperty(name = "所属公司ID",notes = "")
private Long companyId;
/** 任务整点 */
@Excel(name = "任务整点")
@ApiModelProperty(name = "任务整点",notes = "")
private String billModelPoint;
/** 所属组织名称 */
@Excel(name = "所属组织名称")
@ApiModelProperty(name = "所属组织名称",notes = "")
private String orgName;
/** 所属组织ID */
@Excel(name = "所属组织ID")
@ApiModelProperty(name = "所属组织ID",notes = "")
private Long orgId;
/** 数据状态 */
@Excel(name = "数据状态")
@ApiModelProperty(name = "数据状态",notes = "")
private String dataState;
/** 使用状态 */
@Excel(name = "使用状态")
@ApiModelProperty(name = "使用状态",notes = "")
private String useState;
/** 所属专业名称 */
@Excel(name = "所属专业名称")
@ApiModelProperty(name = "所属专业名称",notes = "")
private String fieldName;
@ApiModelProperty(name = "模版类型",notes = "")
private String modelType;
/** 数据录入单模版子信息 */
private List<DcBusiBillModelSub> dcBusiBillModelSubList;

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

@ -78,6 +78,7 @@ public class DcBusiParamBillMaster extends BaseModuleEntity
private String fieldCode;
@ApiModelProperty(name = "专业名称",notes = "")
private String fieldName;
/** 参数数据采集(录入)明细信息 */
private List<DcBusiParamBillSub> dcBusiParamBillSubList;
@ApiModelProperty(name = "data数组数据未转换",notes = "")

100
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetBillMaster.java

@ -0,0 +1,100 @@
package com.lzbi.draft.domain;
import java.util.List;
import java.util.Date;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
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_target_bill_master
*
* @author zhousq
* @date 2023-12-14
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "指标采集(录入)单据主表",description = "")
@TableName("dc_busi_target_bill_master")
public class DcBusiTargetBillMaster extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 单据编号 */
@Excel(name = "单据编号")
@ApiModelProperty(name = "单据编号",notes = "")
private String billNo;
/** 采集时间 */
@Excel(name = "采集时间")
@ApiModelProperty(name = "采集时间",notes = "")
private String billIncomeDate;
/** 单据类型 */
@Excel(name = "单据类型")
@ApiModelProperty(name = "单据类型",notes = "")
private String billType;
/** 审核类型 */
@Excel(name = "审核类型")
@ApiModelProperty(name = "审核类型",notes = "")
private String checkType;
/** 审核状态 */
@Excel(name = "审核状态")
@ApiModelProperty(name = "审核状态",notes = "")
private String checkStatus;
/** 公司ID */
@Excel(name = "公司ID")
@ApiModelProperty(name = "公司ID",notes = "")
private Long companyId;
/** 公司名称 */
@Excel(name = "公司名称")
@ApiModelProperty(name = "公司名称",notes = "")
private String companyName;
/** 组织机构名称 */
@Excel(name = "组织机构名称")
@ApiModelProperty(name = "组织机构名称",notes = "")
private String organizeName;
/** 组织机构ID */
@Excel(name = "组织机构ID")
@ApiModelProperty(name = "组织机构ID",notes = "")
private Long oragnizeId;
/** 指标数据采集(录入)明细信息 */
private List<DcBusiTargetBillSub> dcBusiTargetBillSubList;
@ApiModelProperty(name = "单据模版名称",notes = "")
private String biilModelName ;
@ApiModelProperty(name = "模版编码",notes = "")
private String billModelNo ;
@ApiModelProperty(name = "统计月份",notes = "")
private String countDate ;
@ApiModelProperty(name = "统计日期",notes = "")
private String countTimes;
@ApiModelProperty(name = "专业编码",notes = "")
private String fieldCode;
@ApiModelProperty(name = "专业名称",notes = "")
private String fieldName;
@ApiModelProperty(name = "data数组数据未转换",notes = "")
private JSONArray subDatas;
}

95
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetBillSub.java

@ -0,0 +1,95 @@
package com.lzbi.draft.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 指标数据采集录入明细对象 dc_busi_target_bill_sub
*
* @author zhousq
* @date 2023-12-14
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "指标数据采集(录入)明细表",description = "")
@TableName("dc_busi_target_bill_sub")
public class DcBusiTargetBillSub extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
@ApiModelProperty(name = "主键",notes = "")
private Long id;
/** 单据编码 */
@Excel(name = "单据编码")
@ApiModelProperty(name = "单据编码",notes = "")
private String billNo;
/** 指标名称 */
@Excel(name = "指标名称")
@ApiModelProperty(name = "指标名称",notes = "")
private String targetName;
/** 指标编码 */
@Excel(name = "指标编码")
@ApiModelProperty(name = "指标编码",notes = "")
private String targetCode;
/** 指标单位 */
@Excel(name = "指标单位")
@ApiModelProperty(name = "指标单位",notes = "")
private String targetUint;
/** 指标值 */
@Excel(name = "指标值")
@ApiModelProperty(name = "指标值",notes = "")
private Double targetValue;
/** 统计日期 */
@Excel(name = "统计日期")
@ApiModelProperty(name = "统计日期",notes = "")
private String countDate;
/** 天 */
@Excel(name = "天")
@ApiModelProperty(name = "天",notes = "")
private Integer countDay;
/** 所属专业编码 */
@Excel(name = "所属专业编码")
@ApiModelProperty(name = "所属专业编码",notes = "")
private String fieldCode;
/** 所属专业名称 */
@Excel(name = "所属专业名称")
@ApiModelProperty(name = "所属专业名称",notes = "")
private String fieldName;
/** 统计单元编码 */
@Excel(name = "统计单元编码")
@ApiModelProperty(name = "统计单元编码",notes = "")
private String assetCode;
/** 统计单元名称 */
@Excel(name = "统计单元名称")
@ApiModelProperty(name = "统计单元名称",notes = "")
private String assetName;
}

21
lzbi-module/src/main/java/com/lzbi/draft/domain/DeptQueryParams.java

@ -0,0 +1,21 @@
package com.lzbi.draft.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @auth create by Administrator
* @date 2023/12/14
* DeptQueryParams
*/
@Data
public class DeptQueryParams {
@ApiModelProperty("页码")
private Integer pageNum;
@ApiModelProperty("页长")
private Integer pageSize;
@ApiModelProperty("部门ID")
private Long deptId;
@ApiModelProperty("部门类型")
private String orgType;
}

90
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetBillMasterMapper.java

@ -0,0 +1,90 @@
package com.lzbi.draft.mapper;
import java.util.List;
import com.lzbi.draft.domain.DcBusiTargetBillMaster;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.draft.domain.DcBusiTargetBillSub;
/**
* 统计指标录入Mapper接口
*
* @author zhousq
* @date 2023-12-14
*/
public interface DcBusiTargetBillMasterMapper extends BaseMapper<DcBusiTargetBillMaster>
{
/**
* 查询统计指标录入
*
* @param id 统计指标录入主键
* @return 统计指标录入
*/
public DcBusiTargetBillMaster selectDcBusiTargetBillMasterById(Long id);
/**
* 查询统计指标录入列表
*
* @param dcBusiTargetBillMaster 统计指标录入
* @return 统计指标录入集合
*/
public List<DcBusiTargetBillMaster> selectDcBusiTargetBillMasterList(DcBusiTargetBillMaster dcBusiTargetBillMaster);
/**
* 新增统计指标录入
*
* @param dcBusiTargetBillMaster 统计指标录入
* @return 结果
*/
public int insertDcBusiTargetBillMaster(DcBusiTargetBillMaster dcBusiTargetBillMaster);
/**
* 修改统计指标录入
*
* @param dcBusiTargetBillMaster 统计指标录入
* @return 结果
*/
public int updateDcBusiTargetBillMaster(DcBusiTargetBillMaster dcBusiTargetBillMaster);
/**
* 删除统计指标录入
*
* @param id 统计指标录入主键
* @return 结果
*/
public int deleteDcBusiTargetBillMasterById(Long id);
/**
* 批量删除统计指标录入
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetBillMasterByIds(Long[] ids);
public List<String> selectDcBusiTargetBillMasterBillNoByIds(Long[] ids);
/**
* 批量删除指标数据采集录入明细
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetBillSubByBillNos(List<String> ids);
/**
* 批量新增指标数据采集录入明细
*
* @param dcBusiTargetBillSubList 指标数据采集录入明细列表
* @return 结果
*/
public int batchDcBusiTargetBillSub(List<DcBusiTargetBillSub> dcBusiTargetBillSubList);
/**
* 通过统计指标录入主键删除指标数据采集录入明细信息
*
* @param id 统计指标录入ID
* @return 结果
*/
public int deleteDcBusiTargetBillSubByBillNo(String billNo);
}

133
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetBillMasterService.java

@ -0,0 +1,133 @@
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.DcBusiTargetBillSub;
import com.lzbi.draft.domain.DcBusiTargetBillMaster;
import com.lzbi.draft.mapper.DcBusiTargetBillMasterMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 统计指标录入Service业务层处理
*
* @author zhousq
* @date 2023-12-14
*/
@Service
public class DcBusiTargetBillMasterService extends ServiceImpl<DcBusiTargetBillMasterMapper, DcBusiTargetBillMaster> implements IService<DcBusiTargetBillMaster>
{
/**
* 查询统计指标录入
*
* @param id 统计指标录入主键
* @return 统计指标录入
*/
public DcBusiTargetBillMaster selectDcBusiTargetBillMasterById(Long id)
{
return baseMapper.selectDcBusiTargetBillMasterById(id);
}
/**
* 查询统计指标录入列表
*
* @param dcBusiTargetBillMaster 统计指标录入
* @return 统计指标录入
*/
public List<DcBusiTargetBillMaster> selectDcBusiTargetBillMasterList(DcBusiTargetBillMaster dcBusiTargetBillMaster)
{
return baseMapper.selectDcBusiTargetBillMasterList(dcBusiTargetBillMaster);
}
/**
* 新增统计指标录入
*
* @param dcBusiTargetBillMaster 统计指标录入
* @return 结果
*/
@Transactional
public int insertDcBusiTargetBillMaster(DcBusiTargetBillMaster dcBusiTargetBillMaster)
{
dcBusiTargetBillMaster.setCreatedTime(DateUtils.getNowDate());
int rows = baseMapper.insertDcBusiTargetBillMaster(dcBusiTargetBillMaster);
insertDcBusiTargetBillSub(dcBusiTargetBillMaster);
return rows;
}
/**
* 修改统计指标录入
*
* @param dcBusiTargetBillMaster 统计指标录入
* @return 结果
*/
@Transactional
public int updateDcBusiTargetBillMaster(DcBusiTargetBillMaster dcBusiTargetBillMaster)
{
dcBusiTargetBillMaster.setUpdatedTime(DateUtils.getNowDate());
baseMapper.deleteDcBusiTargetBillSubByBillNo(dcBusiTargetBillMaster.getBillNo());
insertDcBusiTargetBillSub(dcBusiTargetBillMaster);
return baseMapper.updateDcBusiTargetBillMaster(dcBusiTargetBillMaster);
}
/**
* 批量删除统计指标录入
*
* @param ids 需要删除的统计指标录入主键
* @return 结果
*/
@Transactional
public int deleteDcBusiTargetBillMasterByIds(Long[] ids)
{
List<String> strings = baseMapper.selectDcBusiTargetBillMasterBillNoByIds(ids);
baseMapper.deleteDcBusiTargetBillSubByBillNos(strings);
return baseMapper.deleteDcBusiTargetBillMasterByIds(ids);
}
/**
* 删除统计指标录入信息
*
* @param id 统计指标录入主键
* @return 结果
*/
@Transactional
public int deleteDcBusiTargetBillMasterById(Long id)
{
DcBusiTargetBillMaster dcBusiTargetBillMaster = baseMapper.selectDcBusiTargetBillMasterById(id);
baseMapper.deleteDcBusiTargetBillSubByBillNo(dcBusiTargetBillMaster.getBillNo());
return baseMapper.deleteDcBusiTargetBillMasterById(id);
}
/**
* 新增指标数据采集录入明细信息
*
* @param dcBusiTargetBillMaster 统计指标录入对象
*/
public void insertDcBusiTargetBillSub(DcBusiTargetBillMaster dcBusiTargetBillMaster)
{
List<DcBusiTargetBillSub> dcBusiTargetBillSubDaoList = dcBusiTargetBillMaster.getDcBusiTargetBillSubList();
String billNo = dcBusiTargetBillMaster.getBillNo();
if (StringUtils.isNotNull(dcBusiTargetBillSubDaoList))
{
List<DcBusiTargetBillSub> list = new ArrayList<DcBusiTargetBillSub>();
for (DcBusiTargetBillSub dcBusiTargetBillSubDao : dcBusiTargetBillSubDaoList)
{
dcBusiTargetBillSubDao.setBillNo(billNo);
list.add(dcBusiTargetBillSubDao);
}
if (list.size() > 0)
{
baseMapper.batchDcBusiTargetBillSub(list);
}
}
}
}

14
lzbi-module/src/main/resources/mapper/asset/DcBaseCoderuleDefineMapper.xml

@ -129,10 +129,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="codeSplitFlag != null">#{codeSplitFlag},</if>
</trim>
</insert>
<insert id="insertSerial" parameterType="long" useGeneratedKeys="true" keyProperty="id">
<insert id="insertSerial" parameterType="long" >
insert into dc_base_coderule_serial(code_rule_id,serial_id,revision) values (#{param1},0,0)
</insert>
<delete id="deleteSerialByRuleId" parameterType="long" >
delete from dc_base_coderule_serial where code_rule_id=#{param1}
</delete>
<update id="updateDcBaseCoderuleDefineDao" parameterType="DcBaseCoderuleDefineDao">
update dc_base_coderule_define
<trim prefix="SET" suffixOverrides=",">
@ -163,8 +165,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</delete>
<delete id="deleteDcBaseCoderuleserialByIds" parameterType="String">
delete from dc_base_coderule_serial where code_rule_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getSerialByRuleId" resultMap="rmDcBaseCoderuleSerial" parameterType="long">
select
tenant_id,

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

@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="dataState" column="data_state" />
<result property="useState" column="use_state" />
<result property="fieldName" column="field_name" />
<result property="modelType" column="model_type" />
</resultMap>
<resultMap id="DcBusiBillModelMasterDcBusiBillModelSubResult" type="DcBusiBillModelMaster" extends="DcBusiBillModelMasterResult">
@ -48,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDcBusiBillModelMasterVo">
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, dept_id, role_id, bill_model_no, bill_model_name, field_code, company_name, company_id, bill_model_point, org_name, org_id, id, data_state, use_state, field_name from dc_busi_bill_model_master
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, dept_id, role_id, bill_model_no, bill_model_name, field_code, company_name, company_id, bill_model_point, org_name, org_id, id, data_state, use_state, field_name,model_type from dc_busi_bill_model_master
</sql>
<select id="selectDcBusiBillModelMasterList" parameterType="DcBusiBillModelMaster" resultMap="DcBusiBillModelMasterResult">
@ -67,11 +68,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dataState != null and dataState != ''"> and data_state = #{dataState}</if>
<if test="useState != null and useState != ''"> and use_state = #{useState}</if>
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
<if test="modelType != null and modelType != ''"> and model_type =#{modelType}</if>
</where>
</select>
<select id="selectDcBusiBillModelMasterById" parameterType="Long" resultMap="DcBusiBillModelMasterDcBusiBillModelSubResult">
select a.tenant_id, a.revision, a.created_by, a.created_time, a.updated_by, a.updated_time, a.delete_by, a.delete_time, a.dept_id, a.role_id, a.bill_model_no, a.bill_model_name, a.field_code, a.company_name, a.company_id, a.bill_model_point, a.org_name, a.org_id, a.id, a.data_state, a.use_state, a.field_name,
select a.tenant_id, a.revision, a.created_by, a.created_time, a.updated_by, a.updated_time, a.delete_by, a.delete_time, a.dept_id, a.role_id, a.bill_model_no, a.bill_model_name, a.field_code, a.company_name, a.company_id, a.bill_model_point, a.org_name, a.org_id, a.id, a.data_state, a.use_state, a.field_name,a.model_type,
b.bill_model_no as sub_bill_model_no, b.asset_code as sub_asset_code, b.asset_name as sub_asset_name, b.asset_unit_code as sub_asset_unit_code, b.asset_unit_name as sub_asset_unit_name, b.asset_unit_type as sub_asset_unit_type, b.id as sub_id, b.asset_id as sub_asset_id,asset_unit_alials_name as sub_asset_unit_alials_name,a_unit as sub_a_unit
from dc_busi_bill_model_master a
left join dc_busi_bill_model_sub b on b.bill_model_no = a.bill_model_no
@ -102,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dataState != null">data_state,</if>
<if test="useState != null">use_state,</if>
<if test="fieldName != null">field_name,</if>
<if test="modelType != null "> model_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if>
@ -125,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dataState != null">#{dataState},</if>
<if test="useState != null">#{useState},</if>
<if test="fieldName != null">#{fieldName},</if>
<if test="modelType != null "> #{modelType},</if>
</trim>
</insert>
@ -152,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dataState != null">data_state = #{dataState},</if>
<if test="useState != null">use_state = #{useState},</if>
<if test="fieldName != null">field_name = #{fieldName},</if>
<if test="modelType != null"> model_type =#{modelType},</if>
</trim>
where id = #{id}
</update>

181
lzbi-module/src/main/resources/mapper/draft/DcBusiTargetBillMasterMapper.xml

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzbi.draft.mapper.DcBusiTargetBillMasterMapper">
<resultMap type="com.lzbi.draft.domain.DcBusiTargetBillMaster" id="DcBusiTargetBillMasterResult">
<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>
<resultMap id="DcBusiTargetBillMasterDcBusiTargetBillSubResult" type="DcBusiTargetBillMaster" extends="DcBusiTargetBillMasterResult">
<collection property="dcBusiTargetBillSubList" notNullColumn="sub_id" javaType="java.util.List" resultMap="DcBusiTargetBillSubResult" />
</resultMap>
<resultMap type="DcBusiTargetBillSub" id="DcBusiTargetBillSubResult">
<result property="id" column="sub_id" />
<result property="billNo" column="sub_bill_no" />
<result property="targetName" column="sub_target_name" />
<result property="targetCode" column="sub_target_code" />
<result property="targetUint" column="sub_target_uint" />
<result property="targetValue" column="sub_target_value" />
<result property="countDate" column="sub_count_date" />
<result property="countDay" column="sub_count_day" />
<result property="fieldCode" column="sub_field_code" />
<result property="fieldName" column="sub_field_name" />
<result property="assetCode" column="sub_asset_code" />
<result property="assetName" column="sub_asset_name" />
<result property="tenantId" column="sub_tenant_id" />
<result property="revision" column="sub_revision" />
<result property="createdBy" column="sub_created_by" />
<result property="createdTime" column="sub_created_time" />
<result property="updatedBy" column="sub_updated_by" />
<result property="updatedTime" column="sub_updated_time" />
<result property="deleteBy" column="sub_delete_by" />
<result property="deleteTime" column="sub_delete_time" />
</resultMap>
<sql id="selectDcBusiTargetBillMasterVo">
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_target_bill_master
</sql>
<select id="selectDcBusiTargetBillMasterList" parameterType="DcBusiTargetBillMaster" resultMap="DcBusiTargetBillMasterResult">
<include refid="selectDcBusiTargetBillMasterVo"/>
<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="selectDcBusiTargetBillMasterById" parameterType="Long" resultMap="DcBusiTargetBillMasterDcBusiTargetBillSubResult">
select a.id, a.bill_no, a.bill_income_date, a.bill_type, a.check_type, a.check_status, a.tenant_id, a.revision, a.created_by, a.created_time, a.updated_by, a.updated_time, a.delete_by, a.delete_time, a.company_id, a.company_name, a.organize_name, a.oragnize_id,
b.id as sub_id, b.bill_no as sub_bill_no, b.target_name as sub_target_name, b.target_code as sub_target_code, b.target_uint as sub_target_uint, b.target_value as sub_target_value, b.count_date as sub_count_date, b.count_day as sub_count_day, b.field_code as sub_field_code, b.field_name as sub_field_name, b.asset_code as sub_asset_code, b.asset_name as sub_asset_name, b.tenant_id as sub_tenant_id, b.revision as sub_revision, b.created_by as sub_created_by, b.created_time as sub_created_time, b.updated_by as sub_updated_by, b.updated_time as sub_updated_time, b.delete_by as sub_delete_by, b.delete_time as sub_delete_time
from dc_busi_target_bill_master a
left join dc_busi_target_bill_sub b on b.bill_no = a.id
where a.id = #{id}
</select>
<insert id="insertDcBusiTargetBillMaster" parameterType="DcBusiTargetBillMaster" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_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="updateDcBusiTargetBillMaster" parameterType="DcBusiTargetBillMaster">
update dc_busi_target_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>
<delete id="deleteDcBusiTargetBillMasterById" parameterType="Long">
delete from dc_busi_target_bill_master where id = #{id}
</delete>
<select id="selectDcBusiTargetBillMasterBillNoByIds" parameterType="String" resultType="String">
select bill_no from dc_busi_target_bill_master where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<delete id="deleteDcBusiTargetBillMasterByIds" parameterType="String">
delete from dc_busi_target_bill_master where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteDcBusiTargetBillSubByBillNos" parameterType="collection">
delete from dc_busi_target_bill_sub where bill_no in
<foreach item="billNo" collection="list" open="(" separator="," close=")">
#{billNo}
</foreach>
</delete>
<delete id="deleteDcBusiTargetBillSubByBillNo" parameterType="String">
delete from dc_busi_target_bill_sub where bill_no = #{billNo}
</delete>
<insert id="batchDcBusiTargetBillSub">
insert into dc_busi_target_bill_sub( id, bill_no, target_name, target_code, target_uint, target_value, count_date, count_day, field_code, field_name, asset_code, asset_name, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.billNo}, #{item.targetName}, #{item.targetCode}, #{item.targetUint}, #{item.targetValue}, #{item.countDate}, #{item.countDay}, #{item.fieldCode}, #{item.fieldName}, #{item.assetCode}, #{item.assetName}, #{item.tenantId}, #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.deleteBy}, #{item.deleteTime})
</foreach>
</insert>
</mapper>
Loading…
Cancel
Save