Browse Source

1、指标录入单

develop
bobol 10 months ago
parent
commit
41087120c3
  1. 6
      lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java
  2. 38
      lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiTargetInputMasterController.java
  3. 62
      lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiTargetInputMaster.java
  4. 5
      lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiTargetInputSub.java
  5. 8
      lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiTargetInputMasterMapper.java
  6. 3
      lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiTargetInputSubMapper.java
  7. 202
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiTargetInputMasterService.java
  8. 2
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetDraftDaynewController.java
  9. 11
      lzbi-module/src/main/java/com/lzbi/draft/domain/req/ConfirmReq.java
  10. 5
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDaynewMapper.java
  11. 27
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDayMasterService.java
  12. 2
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDaynewService.java
  13. 4
      lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java
  14. 21
      lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml
  15. 14
      lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml
  16. 72
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetInputMasterMapper.xml
  17. 19
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetInputSubMapper.xml
  18. 9
      lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml

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

@ -63,11 +63,17 @@ public class DcBaseAssetInfo extends BaseModuleEntity {
@ApiModelProperty(name = "所属公司",notes = "comanyId")
private Long comanyId;
/** 公司名称 */
private String comanyName;
/** 所属组织结构 */
@Excel(name = "所属组织结构")
@ApiModelProperty(name = "所属组织结构",notes = "orgId")
private Long orgId;
/** 组织名称 */
private String orgName;
public String getValue() {
return this.assetCode;
}

38
lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiTargetInputMasterController.java

@ -86,6 +86,13 @@ public class DcBusiTargetInputMasterController extends BaseController
return success(dcBusiTargetInputMasterService.selectDcBusiTargetInputMasterById(id));
}
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputMaster:query')")
@GetMapping(value = "/billNo/{billNo}")
public AjaxResult getInfo(@PathVariable("billNo") String billNo)
{
return success(dcBusiTargetInputMasterService.selectDcBusiTargetInputMasterByBillNo(billNo));
}
/**
* 新增指标录入单
*/
@ -151,4 +158,35 @@ public class DcBusiTargetInputMasterController extends BaseController
public AjaxResult confirm(@RequestBody ConfirmReq confirmReq) {
return dcBusiTargetInputMasterService.confirm(confirmReq);
}
@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(dcBusiTargetInputMasterService.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(dcBusiTargetInputMasterService.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(dcBusiTargetInputMasterService.checkRevert(billNo));
}
}

62
lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiTargetInputMaster.java

@ -1,6 +1,8 @@
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;
@ -12,9 +14,9 @@ import com.lzbi.module.base.BaseModuleEntity;
/**
* 指标录入单对象 dc_busi_target_input_master
*
*
* @author lienbo
* @date 2024-01-19
* @date 2024-01-22
*/
@Data
@Accessors(chain = true)
@ -22,59 +24,14 @@ public class DcBusiTargetInputMaster extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 单据号 */
@Excel(name = "单据号")
@ApiModelProperty(name = "单据号",notes = "billSerial")
private String billSerial;
/** 单据类别 */
@Excel(name = "单据类别")
@ApiModelProperty(name = "单据类别",notes = "biilType")
private String biilType;
/** 公司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;
/** 统计单元编码 */
@Excel(name = "统计单元编码")
@ApiModelProperty(name = "统计单元编码",notes = "assetCode")
private String assetCode;
/** 统计单元名称 */
@Excel(name = "统计单元名称")
@ApiModelProperty(name = "统计单元名称",notes = "assetName")
private String assetName;
/** 统计专业代码 */
@Excel(name = "统计专业代码")
@ApiModelProperty(name = "统计专业代码",notes = "fieldCode")
private String fieldCode;
/** 统计专业名称 */
@Excel(name = "统计专业名称")
@ApiModelProperty(name = "统计专业名称",notes = "fieldName")
private String fieldName;
/** 主键 */
private Long id;
/** 年 */
@Excel(name = "年")
@ApiModelProperty(name = "年",notes = "year")
@ -107,4 +64,9 @@ public class DcBusiTargetInputMaster extends BaseModuleEntity
@ApiModelProperty(name = "审核类型;1人工2自动",notes = "checkType")
private String checkType;
/**
* 子表
*/
private List<DcBusiTargetInputSub> subList;
}

5
lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiTargetInputSub.java

@ -98,6 +98,11 @@ public class DcBusiTargetInputSub extends BaseModuleEntity
@ApiModelProperty(name = "统计单元名称",notes = "assetName")
private String assetName;
/** 统计单元别名 */
@Excel(name = "统计单元别名")
@ApiModelProperty(name = "统计单元别名",notes = "assetNameAlias")
private String assetNameAlias;
/** 统计专业代码 */
@Excel(name = "统计专业代码")
@ApiModelProperty(name = "统计专业代码",notes = "fieldCode")

8
lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiTargetInputMasterMapper.java

@ -3,6 +3,7 @@ package com.lzbi.bill.mapper;
import java.util.List;
import com.lzbi.bill.domain.DcBusiTargetInputMaster;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* 指标录入单Mapper接口
@ -20,6 +21,13 @@ public interface DcBusiTargetInputMasterMapper extends BaseMapper<DcBusiTargetIn
* @return 指标录入单
*/
public DcBusiTargetInputMaster selectDcBusiTargetInputMasterById(Long id);
/**
* 查询指标录入单
*
* @param billSerial 指标录入单单号
* @return 指标录入单
*/
public DcBusiTargetInputMaster selectDcBusiTargetInputMasterByBillSerial(@Param("billSerial") String billSerial);
/**
* 查询指标录入单列表

3
lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiTargetInputSubMapper.java

@ -3,6 +3,7 @@ package com.lzbi.bill.mapper;
import java.util.List;
import com.lzbi.bill.domain.DcBusiTargetInputSub;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* 指标录入单子Mapper接口
@ -37,6 +38,8 @@ public interface DcBusiTargetInputSubMapper extends BaseMapper<DcBusiTargetInput
*/
public int insertDcBusiTargetInputSub(DcBusiTargetInputSub dcBusiTargetInputSub);
int batchInsertDcBusiTargetInputSub(@Param("list") List<DcBusiTargetInputSub> list);
/**
* 修改指标录入单子
*

202
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiTargetInputMasterService.java

@ -7,11 +7,16 @@ import com.lzbi.asset.mapper.DcBaseAssetInfoMapper;
import com.lzbi.bill.domain.DcBusiTargetInputMaster;
import com.lzbi.bill.domain.DcBusiTargetInputSub;
import com.lzbi.bill.mapper.DcBusiTargetInputMasterMapper;
import com.lzbi.bill.mapper.DcBusiTargetInputSubMapper;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.common.utils.SecurityUtils;
import com.lzbi.draft.domain.DcBusiTargetAdjustDayMasterDao;
import com.lzbi.draft.domain.DcBusiTargetDraftDaynew;
import com.lzbi.draft.domain.req.ConfirmReq;
import com.lzbi.draft.domain.req.ProductionDailySheetReq;
import com.lzbi.draft.domain.vo.ProductionDailySheetVO;
import com.lzbi.draft.mapper.DcBusiTargetDraftDaynewMapper;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.collections4.IteratorUtils;
@ -23,6 +28,7 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
@ -35,6 +41,9 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@ -53,6 +62,14 @@ public class DcBusiTargetInputMasterService extends ServiceImpl<DcBusiTargetInpu
@Resource
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper;
@Resource
private DcBusiTargetInputSubMapper dcBusiTargetInputSubMapper;
@Resource
private DcBusiTargetDraftDaynewMapper dcBusiTargetDraftDaynewMapper;
private static final Lock lock = new ReentrantLock();
/**
* 查询指标录入单
*
@ -64,6 +81,16 @@ public class DcBusiTargetInputMasterService extends ServiceImpl<DcBusiTargetInpu
return baseMapper.selectDcBusiTargetInputMasterById(id);
}
public DcBusiTargetInputMaster selectDcBusiTargetInputMasterByBillNo(String billNo) {
DcBusiTargetInputMaster master = baseMapper.selectDcBusiTargetInputMasterByBillSerial(billNo);
DcBusiTargetInputSub params = new DcBusiTargetInputSub();
params.setBillNoMaster(billNo);
List<DcBusiTargetInputSub> subList = dcBusiTargetInputSubMapper.selectDcBusiTargetInputSubList(params);
master.setSubList(subList);
return master;
}
/**
* 查询指标录入单列表
*
@ -81,10 +108,14 @@ public class DcBusiTargetInputMasterService extends ServiceImpl<DcBusiTargetInpu
* @param dcBusiTargetInputMaster 指标录入单
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
public int insertDcBusiTargetInputMaster(DcBusiTargetInputMaster dcBusiTargetInputMaster)
{
dcBusiTargetInputSubMapper.batchInsertDcBusiTargetInputSub(dcBusiTargetInputMaster.getSubList());
dcBusiTargetInputMaster.setCreatedTime(DateUtils.getNowDate());
dcBusiTargetInputMaster.setDeptId(SecurityUtils.getDeptId());
dcBusiTargetInputMaster.setUserId(SecurityUtils.getUserId());
dcBusiTargetInputMaster.setCreatedBy(SecurityUtils.getUsername());
return baseMapper.insertDcBusiTargetInputMaster(dcBusiTargetInputMaster);
}
@ -200,22 +231,26 @@ public class DcBusiTargetInputMasterService extends ServiceImpl<DcBusiTargetInpu
Map<String, DcBaseAssetTarget> dcBaseAssetTargetMap = targetMap.get(name);
List<List<String>> data = productionDailySheetReq.getData();
if (!CollectionUtils.isEmpty(data)) {
Map<Integer, Integer> dayMap = new HashMap<>();
Map<String, Integer> dayMap = new HashMap<>();
boolean sign = false;
for (int i = 0, leni = data.size(); i < leni; i++) {
List<String> row = data.get(i);
if ("日期".equals(row.get(0))) {
Map<String, Integer> columnMap = new HashMap<>();
int lenj = row.size();
for (int j = 1; j < lenj; j++) {
if (!columnMap.containsKey(row.get(j))) {
columnMap.put(row.get(j), j);
String column = row.get(j);
if ("合计".equals(column)) {
break;
}
}
for (int j = 1; j <= 31 && j < lenj; j++) {
String key = j + "日";
if (columnMap.containsKey(key) && !dayMap.containsKey(key)) {
dayMap.put(j, columnMap.get(key));
if (Pattern.matches("\\d+[日]+", column)) {
String day = column.substring(0, column.length() - 1);
if (Integer.parseInt(day) > confirmReq.getDays()) {
continue;
}
if (dayMap.containsKey(day)) {
break;
}
dayMap.put(day, j);
}
}
sign = true;
@ -232,16 +267,22 @@ public class DcBusiTargetInputMasterService extends ServiceImpl<DcBusiTargetInpu
String v = row.get(index);
if (StringUtils.isNotBlank(v)) {
DcBusiTargetInputSub dcBusiTargetInputSub = new DcBusiTargetInputSub();
BeanUtils.copyProperties(dcBaseAssetTarget, dcBusiTargetInputSub);
dcBusiTargetInputSub.setTargetCode(dcBaseAssetTarget.getTargetCode());
dcBusiTargetInputSub.setTargetName(dcBaseAssetTarget.getTargetName());
dcBusiTargetInputSub.setTagetUnit(dcBaseAssetTarget.getFieldUnit());
dcBusiTargetInputSub.setFieldCode(dcBaseAssetTarget.getFieldCode());
dcBusiTargetInputSub.setFieldName(dcBaseAssetTarget.getFieldName());
dcBusiTargetInputSub.setAssetCode(dcBaseAssetInfo.getAssetCode());
dcBusiTargetInputSub.setAssetName(dcBaseAssetInfo.getAssetName());
dcBusiTargetInputSub.setAssetNameAlias(dcBaseAssetInfo.getAssetNameAlias());
dcBusiTargetInputSub.setCompanyId(dcBaseAssetInfo.getComanyId());
dcBusiTargetInputSub.setOragnizeId(dcBaseAssetInfo.getOrgId());
// dcBusiTargetInputSub.setCompanyName();
// dcBusiTargetInputSub.setOrganizeName();
dcBusiTargetInputSub.setCompanyName(dcBaseAssetInfo.getComanyName());
dcBusiTargetInputSub.setOrganizeName(dcBaseAssetInfo.getOrgName());
dcBusiTargetInputSub.setTagetUnit(dcBaseAssetTarget.getFieldUnit());
dcBusiTargetInputSub.setDay(String.valueOf(day));
dcBusiTargetInputSub.setValResult(new BigDecimal(v));
dcBusiTargetInputSub.setBillNoMaster(confirmReq.getBillNo());
result.add(dcBusiTargetInputSub);
}
});
@ -252,4 +293,139 @@ public class DcBusiTargetInputMasterService extends ServiceImpl<DcBusiTargetInpu
}
return AjaxResult.success(result);
}
@Transactional(rollbackFor = Exception.class)
public int checkBack(String billNo) {
lock.lock();
try {
DcBusiTargetInputMaster master = baseMapper.selectDcBusiTargetInputMasterByBillSerial(billNo);
if ("2".equals(master.getCheckStatus())) {
throw new RuntimeException("审核失败,单据已审核");
}
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setCheckStatus("9");
return baseMapper.updateDcBusiTargetInputMaster(master);
} catch (RuntimeException e) {
log.error("处理异常", e);
throw e;
} finally {
lock.unlock();
}
}
@Transactional(rollbackFor = Exception.class)
public int checkPass(String billNo) {
lock.lock();
try {
DcBusiTargetInputMaster master = baseMapper.selectDcBusiTargetInputMasterByBillSerial(billNo);
if (ObjectUtils.isEmpty(master)) {
throw new RuntimeException("单据不存在");
}
if ("2".equals(master.getCheckStatus())) {
throw new RuntimeException("审核失败,单据已审核");
}
DcBusiTargetInputSub subParams = new DcBusiTargetInputSub();
subParams.setBillNoMaster(billNo);
List<DcBusiTargetInputSub> dcBusiTargetInputSubList = dcBusiTargetInputSubMapper.selectDcBusiTargetInputSubList(subParams);
List<DcBusiTargetDraftDaynew> newList = new ArrayList<>();
if (!CollectionUtils.isEmpty(dcBusiTargetInputSubList)) {
String year = master.getYear();
String month = master.getMonth();
List<String> targetCodeList = dcBusiTargetInputSubList.stream().map(DcBusiTargetInputSub::getTargetCode).collect(Collectors.toList());
List<DcBaseAssetTarget> dcBaseAssetTargets = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeList(targetCodeList);
Map<String, String> targetModelCodeMap = dcBaseAssetTargets.stream().collect(Collectors.toMap(DcBaseAssetTarget::getTargetCode, DcBaseAssetTarget::getTargetModelCode));
for (DcBusiTargetInputSub dcBusiTargetInputSub : dcBusiTargetInputSubList) {
String day = dcBusiTargetInputSub.getDay();
DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew = new DcBusiTargetDraftDaynew();
dcBusiTargetDraftDaynew.setCompanyId(dcBusiTargetInputSub.getCompanyId());
dcBusiTargetDraftDaynew.setOrganizeId(dcBusiTargetInputSub.getOragnizeId());
dcBusiTargetDraftDaynew.setAssetCode(dcBusiTargetInputSub.getAssetCode());
dcBusiTargetDraftDaynew.setFieldCode(dcBusiTargetInputSub.getFieldCode());
dcBusiTargetDraftDaynew.setTargetCode(dcBusiTargetInputSub.getTargetCode());
dcBusiTargetDraftDaynew.setDateYear(year);
dcBusiTargetDraftDaynew.setDateMonth(month);
dcBusiTargetDraftDaynew.setDateDay(day);
List<DcBusiTargetDraftDaynew> dcBusiTargetDraftDaynewList = dcBusiTargetDraftDaynewMapper.selectDcBusiTargetDraftDaynewList(dcBusiTargetDraftDaynew);
if (CollectionUtils.isEmpty(dcBusiTargetDraftDaynewList)) {
dcBusiTargetDraftDaynew.setCompanyName(dcBusiTargetInputSub.getCompanyName());
dcBusiTargetDraftDaynew.setOrganizeName(dcBusiTargetInputSub.getOrganizeName());
dcBusiTargetDraftDaynew.setAssetName(dcBusiTargetInputSub.getAssetName());
dcBusiTargetDraftDaynew.setFieldName(dcBusiTargetInputSub.getFieldName());
dcBusiTargetDraftDaynew.setTagetName(dcBusiTargetInputSub.getTargetName());
dcBusiTargetDraftDaynew.setValueResult(dcBusiTargetInputSub.getValResult());
dcBusiTargetDraftDaynew.setTargetModelCode(targetModelCodeMap.get(dcBusiTargetInputSub.getTargetCode()));
newList.add(dcBusiTargetDraftDaynew);
} else {
String msg = "{} 中 {} {}-{}-{},已存在";
throw new RuntimeException(String.format(msg, dcBusiTargetInputSub.getAssetNameAlias(), dcBusiTargetInputSub.getTargetName(), year, month, StringUtils.leftPad(day, 2, "0")));
}
}
dcBusiTargetDraftDaynewMapper.batchInsertDcBusiTargetDraftDaynew(newList);
}
// 修改审核状态为已处理
master.setCheckStatus("2");
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiTargetInputMaster(master);
} catch (RuntimeException e) {
log.error("处理异常", e);
throw e;
} finally {
lock.unlock();
}
}
public int checkRevert(String billNo) {
lock.lock();
try {
DcBusiTargetInputMaster master = baseMapper.selectDcBusiTargetInputMasterByBillSerial(billNo);
if ("0".equals(master.getCheckStatus())) {
throw new RuntimeException("反审核失败,单据未提交");
}
if ("1".equals(master.getCheckStatus())) {
throw new RuntimeException("反审核失败,单据未审核通过");
}
DcBusiTargetInputSub subParams = new DcBusiTargetInputSub();
subParams.setBillNoMaster(billNo);
List<DcBusiTargetInputSub> dcBusiTargetInputSubList = dcBusiTargetInputSubMapper.selectDcBusiTargetInputSubList(subParams);
List<DcBusiTargetDraftDaynew> newList = new ArrayList<>();
if (!CollectionUtils.isEmpty(dcBusiTargetInputSubList)) {
String year = master.getYear();
String month = master.getMonth();
for (DcBusiTargetInputSub dcBusiTargetInputSub : dcBusiTargetInputSubList) {
String day = dcBusiTargetInputSub.getDay();
DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew = new DcBusiTargetDraftDaynew();
dcBusiTargetDraftDaynew.setCompanyId(dcBusiTargetInputSub.getCompanyId());
dcBusiTargetDraftDaynew.setOrganizeId(dcBusiTargetInputSub.getOragnizeId());
dcBusiTargetDraftDaynew.setAssetCode(dcBusiTargetInputSub.getAssetCode());
dcBusiTargetDraftDaynew.setFieldCode(dcBusiTargetInputSub.getFieldCode());
dcBusiTargetDraftDaynew.setTargetCode(dcBusiTargetInputSub.getTargetCode());
dcBusiTargetDraftDaynew.setDateYear(year);
dcBusiTargetDraftDaynew.setDateMonth(month);
dcBusiTargetDraftDaynew.setDateDay(day);
List<DcBusiTargetDraftDaynew> dcBusiTargetDraftDaynewList = dcBusiTargetDraftDaynewMapper.selectDcBusiTargetDraftDaynewList(dcBusiTargetDraftDaynew);
if (!CollectionUtils.isEmpty(dcBusiTargetDraftDaynewList)) {
newList.addAll(dcBusiTargetDraftDaynewList);
}
}
if (!CollectionUtils.isEmpty(newList)) {
List<Long> idList = newList.stream().map(DcBusiTargetDraftDaynew::getId).collect(Collectors.toList());
Long[] ids = idList.toArray(new Long[]{});
dcBusiTargetDraftDaynewMapper.deleteDcBusiTargetDraftDaynewByIds(ids);
}
}
// 修改审核状态为已处理
master.setCheckStatus("1");
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiTargetInputMaster(master);
} catch (RuntimeException e) {
log.error("处理异常", e);
throw e;
} finally {
lock.unlock();
}
}
}

2
lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetDraftDaynewController.java

@ -124,7 +124,7 @@ public class DcBusiTargetDraftDaynewController extends BaseController
@PreAuthorize("@ss.hasPermi('bi:dcBusiTargetDraftDaynew:remove')")
@Log(title = "指标数据底稿日-新结构", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiTargetDraftDaynewService.deleteDcBusiTargetDraftDaynewByIds(ids));
}

11
lzbi-module/src/main/java/com/lzbi/draft/domain/req/ConfirmReq.java

@ -7,5 +7,16 @@ import java.util.List;
@Data
public class ConfirmReq {
/**
* sheet页数据
*/
private List<ProductionDailySheetReq> list;
/**
* 单据号
*/
private String billNo;
/**
* 天数
*/
private int days;
}

5
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDaynewMapper.java

@ -3,6 +3,7 @@ package com.lzbi.draft.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.draft.domain.DcBusiTargetDraftDaynew;
import org.apache.ibatis.annotations.Param;
/**
* 指标数据底稿日-新结构Mapper接口
@ -37,6 +38,8 @@ public interface DcBusiTargetDraftDaynewMapper extends BaseMapper<DcBusiTargetDr
*/
public int insertDcBusiTargetDraftDaynew(DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew);
int batchInsertDcBusiTargetDraftDaynew(@Param("list") List<DcBusiTargetDraftDaynew> list);
/**
* 修改指标数据底稿日-新结构
*
@ -59,5 +62,5 @@ public interface DcBusiTargetDraftDaynewMapper extends BaseMapper<DcBusiTargetDr
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetDraftDaynewByIds(String[] ids);
public int deleteDcBusiTargetDraftDaynewByIds(Long[] ids);
}

27
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDayMasterService.java

@ -223,11 +223,22 @@ public class DcBusiTargetAdjustDayMasterService extends ServiceImpl<DcBusiTarget
}
public int checkBack(String billNo) {
DcBusiTargetAdjustDayMasterDao master = baseMapper.selectDcBusiTargetAdjustDayMasterDaoByBillNo(billNo);
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setCheckStatus("0");
return baseMapper.updateDcBusiTargetAdjustDayMasterDao(master);
lock.lock();
try {
DcBusiTargetAdjustDayMasterDao master = baseMapper.selectDcBusiTargetAdjustDayMasterDaoByBillNo(billNo);
if ("2".equals(master.getCheckStatus())) {
throw new RuntimeException("审核失败,单据已审核");
}
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setCheckStatus("0");
return baseMapper.updateDcBusiTargetAdjustDayMasterDao(master);
} catch (RuntimeException e) {
log.error("处理异常", e);
throw e;
} finally {
lock.unlock();
}
}
@Transactional(rollbackFor = Exception.class)
@ -244,9 +255,9 @@ public class DcBusiTargetAdjustDayMasterService extends ServiceImpl<DcBusiTarget
}
String dateAdjust = dcBusiTargetAdjustDayMasterDao.getDateAdjust();
String[] dataStrArr = dateAdjust.split("-");
String year = null;
String month = null;
String day = null;
String year;
String month;
String day;
if (dataStrArr.length == 3) {
year = dataStrArr[0];
month = dataStrArr[1];

2
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDaynewService.java

@ -72,7 +72,7 @@ public class DcBusiTargetDraftDaynewService extends ServiceImpl<DcBusiTargetDraf
* @return 结果
*/
public int deleteDcBusiTargetDraftDaynewByIds(String[] ids)
public int deleteDcBusiTargetDraftDaynewByIds(Long[] ids)
{
return baseMapper.deleteDcBusiTargetDraftDaynewByIds(ids);
}

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

@ -42,6 +42,8 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTarget>
*/
public List<DcBaseAssetTarget> selectDcBaseAssetTargetList(DcBaseAssetTarget dcBaseAssetTarget);
List<DcBaseAssetTarget> selectDcBaseAssetTargetByTargetCodeList(@Param("targetCodeList") List<String> targetCodeList);
/**
* 新增资产指标配置
@ -78,6 +80,4 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTarget>
public List<DcBaseAssetTargetExpand> selectDcBaseAssetTargetExpandList(DcBaseAssetTargetExpand dcBaseAssetTargetExpand);
}

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

@ -23,6 +23,7 @@
<result property="flagValidateUser" column="flag_validate_user"/>
<result property="statusAsset" column="status_asset"/>
<result property="comanyId" column="comany_id"/>
<result property="orgId" column="org_id"/>
<result property="deptId" column="dept_id"/>
</resultMap>
@ -45,6 +46,7 @@
flag_validate_user,
status_asset,
comany_id,
org_id,
dept_id
from dc_base_asset_info
</sql>
@ -73,9 +75,22 @@
<include refid="selectDcBaseAssetInfoVo"/>
where id = #{id}
</select>
<select id="selectDcBaseAssetInfoByAliasName" parameterType="java.lang.String" resultMap="DcBaseAssetInfoResult">
<include refid="selectDcBaseAssetInfoVo"/>
where asset_name_alias = #{assetNameAlias}
<select id="selectDcBaseAssetInfoByAliasName" parameterType="java.lang.String" resultType="com.lzbi.asset.domain.DcBaseAssetInfo">
SELECT
t1.id,
t1.asset_name AS "assetName",
t1.asset_name_alias AS "assetNameAlias",
t1.asset_code AS "assetCode",
t1.comany_id AS "comanyId",
t2.dept_name AS "comanyName",
t1.org_id AS "orgId",
t3.dept_name AS "orgName"
FROM
dc_base_asset_info t1
LEFT JOIN sys_dept t2 ON t1.comany_id = t2.dept_id
LEFT JOIN sys_dept t3 ON t1.org_id = t3.dept_id
where t1.asset_name_alias = #{assetNameAlias}
</select>
<select id="selectDcBaseAssetInfoByCode" parameterType="String" resultMap="DcBaseAssetInfoResult">

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

@ -130,6 +130,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="valueAdjust != null">#{valueAdjust},</if>
</trim>
</insert>
<insert id="batchInsertDcBusiTargetDraftDaynew">
insert into dc_busi_target_draft_daynew
(company_id, company_name, organize_id, organize_name, asset_code, asset_name,
target_code, taget_name, target_model_code, date_year, date_month, date_day,
value_result, field_code, field_name)
values
<foreach collection="list" item="item" separator=",">
(#{item.companyId}, #{item.companyName}, #{item.organizeId}, #{item.organizeName}, #{item.assetCode}, #{item.assetName},
#{item.targetCode}, #{item.tagetName}, #{item.targetModelCode}, #{item.dateYear}, #{item.dateMonth}, #{item.dateDay},
#{item.valueResult}, #{item.fieldCode}, #{item.fieldName})
</foreach>
</insert>
<update id="updateDcBusiTargetDraftDaynew" parameterType="DcBusiTargetDraftDaynew">
update dc_busi_target_draft_daynew
@ -169,7 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from dc_busi_target_draft_daynew where id = #{id}
</delete>
<delete id="deleteDcBusiTargetDraftDaynewByIds" parameterType="String">
<delete id="deleteDcBusiTargetDraftDaynewByIds" parameterType="Long">
delete from dc_busi_target_draft_daynew where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}

72
lzbi-module/src/main/resources/mapper/draft/DcBusiTargetInputMasterMapper.xml

@ -1,21 +1,12 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzbi.bill.mapper.DcBusiTargetInputMasterMapper">
<resultMap type="com.lzbi.bill.domain.DcBusiTargetInputMaster" id="DcBusiTargetInputMasterResult">
<result property="billSerial" column="bill_serial" />
<result property="biilType" column="biil_type" />
<result property="companyId" column="company_id" />
<result property="companyName" column="company_name" />
<result property="organizeName" column="organize_name" />
<result property="oragnizeId" column="oragnize_id" />
<result property="assetCode" column="asset_code" />
<result property="assetName" column="asset_name" />
<result property="fieldCode" column="field_code" />
<result property="fieldName" column="field_name" />
<result property="id" column="id" />
<result property="billSerial" column="bill_serial" />
<result property="year" column="year" />
<result property="month" column="month" />
<result property="tenantId" column="tenant_id" />
@ -31,47 +22,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDcBusiTargetInputMasterVo">
select bill_serial, biil_type, company_id, company_name, organize_name, oragnize_id, asset_code, asset_name, field_code, field_name, id, year, month, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, check_status, check_type from dc_busi_target_input_master
select id, bill_serial, year, month, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, check_status, check_type from dc_busi_target_input_master
</sql>
<select id="selectDcBusiTargetInputMasterList" parameterType="DcBusiTargetInputMaster" resultMap="DcBusiTargetInputMasterResult">
<include refid="selectDcBusiTargetInputMasterVo"/>
<where>
<where>
<if test="billSerial != null and billSerial != ''"> and bill_serial = #{billSerial}</if>
<if test="biilType != null and biilType != ''"> and biil_type = #{biilType}</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>
<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="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if>
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
<if test="year != null and year != ''"> and year = #{year}</if>
<if test="month != null and month != ''"> and month = #{month}</if>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
<if test="checkType != null and checkType != ''"> and check_type = #{checkType}</if>
</where>
</select>
<select id="selectDcBusiTargetInputMasterById" parameterType="Long" resultMap="DcBusiTargetInputMasterResult">
<include refid="selectDcBusiTargetInputMasterVo"/>
where id = #{id}
</select>
<select id="selectDcBusiTargetInputMasterByBillSerial"
resultType="com.lzbi.bill.domain.DcBusiTargetInputMaster">
<include refid="selectDcBusiTargetInputMasterVo"/>
where bill_serial = #{billSerial}
</select>
<insert id="insertDcBusiTargetInputMaster" parameterType="DcBusiTargetInputMaster" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_input_master
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billSerial != null">bill_serial,</if>
<if test="biilType != null">biil_type,</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>
<if test="assetCode != null">asset_code,</if>
<if test="assetName != null">asset_name,</if>
<if test="fieldCode != null">field_code,</if>
<if test="fieldName != null">field_name,</if>
<if test="year != null">year,</if>
<if test="month != null">month,</if>
<if test="tenantId != null">tenant_id,</if>
@ -84,18 +62,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deleteTime != null">delete_time,</if>
<if test="checkStatus != null">check_status,</if>
<if test="checkType != null">check_type,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billSerial != null">#{billSerial},</if>
<if test="biilType != null">#{biilType},</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>
<if test="assetCode != null">#{assetCode},</if>
<if test="assetName != null">#{assetName},</if>
<if test="fieldCode != null">#{fieldCode},</if>
<if test="fieldName != null">#{fieldName},</if>
<if test="year != null">#{year},</if>
<if test="month != null">#{month},</if>
<if test="tenantId != null">#{tenantId},</if>
@ -108,22 +77,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deleteTime != null">#{deleteTime},</if>
<if test="checkStatus != null">#{checkStatus},</if>
<if test="checkType != null">#{checkType},</if>
</trim>
</trim>
</insert>
<update id="updateDcBusiTargetInputMaster" parameterType="DcBusiTargetInputMaster">
update dc_busi_target_input_master
<trim prefix="SET" suffixOverrides=",">
<if test="billSerial != null">bill_serial = #{billSerial},</if>
<if test="biilType != null">biil_type = #{biilType},</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>
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetName != null">asset_name = #{assetName},</if>
<if test="fieldCode != null">field_code = #{fieldCode},</if>
<if test="fieldName != null">field_name = #{fieldName},</if>
<if test="year != null">year = #{year},</if>
<if test="month != null">month = #{month},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
@ -145,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteDcBusiTargetInputMasterByIds" parameterType="String">
delete from dc_busi_target_input_master where id in
delete from dc_busi_target_input_master where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

19
lzbi-module/src/main/resources/mapper/draft/DcBusiTargetInputSubMapper.xml

@ -26,12 +26,13 @@
<result property="oragnizeId" column="oragnize_id" />
<result property="assetCode" column="asset_code" />
<result property="assetName" column="asset_name" />
<result property="assetNameAlias" column="asset_name_alias" />
<result property="fieldCode" column="field_code" />
<result property="fieldName" column="field_name" />
</resultMap>
<sql id="selectDcBusiTargetInputSubVo">
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, id, bill_no_master, target_code, target_name, taget_unit, day, val_result, company_id, company_name, organize_name, oragnize_id, asset_code, asset_name, field_code, field_name from dc_busi_target_input_sub
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, id, bill_no_master, target_code, target_name, taget_unit, day, val_result, company_id, company_name, organize_name, oragnize_id, asset_code, asset_name, asset_name_alias, field_code, field_name from dc_busi_target_input_sub
</sql>
<select id="selectDcBusiTargetInputSubList" parameterType="DcBusiTargetInputSub" resultMap="DcBusiTargetInputSubResult">
@ -49,6 +50,7 @@
<if test="oragnizeId != null "> and oragnize_id = #{oragnizeId}</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="assetNameAlias != null and assetNameAlias != ''"> and asset_name_alias = #{assetNameAlias}</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>
</where>
@ -83,6 +85,7 @@
<if test="oragnizeId != null">oragnize_id,</if>
<if test="assetCode != null">asset_code,</if>
<if test="assetName != null">asset_name,</if>
<if test="assetNameAlias != null">asset_name_alias,</if>
<if test="fieldCode != null">field_code,</if>
<if test="fieldName != null">field_name,</if>
</trim>
@ -107,11 +110,24 @@
<if test="oragnizeId != null">#{oragnizeId},</if>
<if test="assetCode != null">#{assetCode},</if>
<if test="assetName != null">#{assetName},</if>
<if test="assetNameAlias != null">#{assetNameAlias},</if>
<if test="fieldCode != null">#{fieldCode},</if>
<if test="fieldName != null">#{fieldName},</if>
</trim>
</insert>
<insert id="batchInsertDcBusiTargetInputSub">
insert into dc_busi_target_input_sub
(bill_no_master, company_id, company_name, oragnize_id, organize_name, asset_code, asset_name, asset_name_alias,
target_code, target_name, taget_unit, day, val_result, field_code, field_name)
values
<foreach collection="list" item="item" separator=",">
(#{item.billNoMaster}, #{item.companyId}, #{item.companyName}, #{item.oragnizeId}, #{item.organizeName}, #{item.assetCode}, #{item.assetName},
#{item.assetNameAlias}, #{item.targetCode}, #{item.targetName}, #{item.tagetUnit}, #{item.day}, #{item.valResult}, #{item.fieldCode},
#{item.fieldName})
</foreach>
</insert>
<update id="updateDcBusiTargetInputSub" parameterType="DcBusiTargetInputSub">
update dc_busi_target_input_sub
<trim prefix="SET" suffixOverrides=",">
@ -135,6 +151,7 @@
<if test="oragnizeId != null">oragnize_id = #{oragnizeId},</if>
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetName != null">asset_name = #{assetName},</if>
<if test="assetNameAlias != null">asset_name_alias = #{assetNameAlias},</if>
<if test="fieldCode != null">field_code = #{fieldCode},</if>
<if test="fieldName != null">field_name = #{fieldName},</if>
</trim>

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

@ -98,6 +98,15 @@
ORDER BY COALESCE(updated_time, created_time) DESC
</select>
<select id="selectDcBaseAssetTargetByTargetCodeList"
resultType="com.lzbi.targetFolder.domain.DcBaseAssetTarget">
<include refid="selectDcBaseAssetTargetVo"/>
where target_code in
<foreach item="targetCode" collection="targetCodeList" open="(" separator="," close=")">
#{targetCode}
</foreach>
</select>
<select id="selectDcBaseAssetTargetById" parameterType="Long" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/>
where id = #{id}

Loading…
Cancel
Save