Browse Source

2023-12-18 参数采集单审核

develop
zhousq 9 months ago
parent
commit
edbb63ae65
  1. 2
      lzbi-admin/src/main/resources/application.yml
  2. 1
      lzbi-common/src/main/java/com/lzbi/common/core/controller/BaseController.java
  3. 8
      lzbi-module/src/main/java/com/lzbi/code/service/CodeNoGenerater.java
  4. 111
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamBillMasterController.java
  5. 3
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiParamBillMasterMapper.java
  6. 14
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiParamBillMasterService.java
  7. 2
      lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml
  8. 2
      lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml
  9. 27
      lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml
  10. 15
      lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillSubMapper.xml

2
lzbi-admin/src/main/resources/application.yml

@ -100,7 +100,7 @@ pagehelper:
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
enabled: false
# 请求前缀
pathMapping: /

1
lzbi-common/src/main/java/com/lzbi/common/core/controller/BaseController.java

@ -26,6 +26,7 @@ import com.lzbi.common.utils.sql.SqlUtil;
*
* @author ruoyi
*/
public class BaseController
{
protected final Logger logger = LoggerFactory.getLogger(this.getClass());

8
lzbi-module/src/main/java/com/lzbi/code/service/CodeNoGenerater.java

@ -36,7 +36,13 @@ public class CodeNoGenerater {
//
String spitChar= Optional.ofNullable(ruleDao.getCodeSplitFlag()).orElse("");
spitChar=spitChar.equals("*")?"":spitChar;
codeBuffer.append(ruleDao.getCodeHeader()).append(spitChar).append(getBody(ruleDao)).append(spitChar).append(StringUtils.leftPad(serial,serialLen,'0'));
String body=getBody(ruleDao);
codeBuffer.append(ruleDao.getCodeHeader());
if(!"".equals(body)){
codeBuffer.append(spitChar);
codeBuffer.append(body);
}
codeBuffer.append(spitChar).append(StringUtils.leftPad(serial,serialLen,'0'));
return codeBuffer.toString();
}

111
lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamBillMasterController.java

@ -1,24 +1,25 @@
package com.lzbi.draft.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.common.utils.SecurityUtils;
import com.lzbi.draft.domain.DcBusiParamBillSub;
import com.lzbi.draft.service.DcBusiParamBillSubService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
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.DcBusiParamBillMaster;
import com.lzbi.draft.service.DcBusiParamBillMasterService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
/**
@ -29,15 +30,21 @@ import com.lzbi.common.core.page.TableDataInfo;
*/
@RestController
@RequestMapping("/draft/paramInBill")
public class DcBusiParamBillMasterController extends BaseController
{
@Autowired
private DcBusiParamBillMasterService dcBusiParamBillMasterService;
@Autowired
private DcBusiParamBillSubService dcBusiParamBillSubService;
/**
* 查询参数采集录入单据主列表
*/
@PreAuthorize("@ss.hasPermi('param:paramData:list')")
//@PreAuthorize("@ss.hasPermi('param:paramData:list')")
@ApiOperation("参数采集单详情")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiParamBillMaster", value = "", dataType = "DcBusiParamBillMaster", dataTypeClass = DcBusiParamBillMaster.class),
})
@GetMapping("/list")
public TableDataInfo list(DcBusiParamBillMaster dcBusiParamBillMasterDao)
{
@ -46,59 +53,43 @@ public class DcBusiParamBillMasterController extends BaseController
return getDataTable(list);
}
/**
* 导出参数采集录入单据主列表
*/
@PreAuthorize("@ss.hasPermi('param:paramData:export')")
@Log(title = "参数采集(录入)单据主", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcBusiParamBillMaster dcBusiParamBillMasterDao)
{
List<DcBusiParamBillMaster> list = dcBusiParamBillMasterService.selectDcBusiParamBillMasterDaoList(dcBusiParamBillMasterDao);
ExcelUtil<DcBusiParamBillMaster> util = new ExcelUtil<DcBusiParamBillMaster>(DcBusiParamBillMaster.class);
util.exportExcel(response, list, "参数采集(录入)单据主数据");
@ApiOperation("参数采集单详情")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@GetMapping("/detail/{billNo}")
public AjaxResult getParamInBillDetail(@PathVariable String billNo){
DcBusiParamBillSub sub=new DcBusiParamBillSub();
sub.setBillNo(billNo);
List<DcBusiParamBillSub> list = dcBusiParamBillSubService.selectByVo(sub);
return AjaxResult.success(list);
}
/**
* 获取参数采集录入单据主详细信息
*/
@PreAuthorize("@ss.hasPermi('param:paramData:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiParamBillMasterService.selectDcBusiParamBillMasterDaoById(id));
@ApiOperation("采集单驳回")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@GetMapping("/checkBack/{billNo}")
public AjaxResult checkParamInBillBack(@PathVariable String billNo){
DcBusiParamBillMaster master=new DcBusiParamBillMaster();
master.setBillNo(billNo);
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setCheckStatus("9");
return AjaxResult.success(dcBusiParamBillMasterService.checkBill(master));
}
/**
* 新增参数采集录入单据主
*/
@PreAuthorize("@ss.hasPermi('param:paramData:add')")
@Log(title = "参数采集(录入)单据主", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiParamBillMaster dcBusiParamBillMasterDao)
{
return toAjax(dcBusiParamBillMasterService.insertDcBusiParamBillMasterDao(dcBusiParamBillMasterDao));
}
/**
* 修改参数采集录入单据主
*/
@PreAuthorize("@ss.hasPermi('param:paramData:edit')")
@Log(title = "参数采集(录入)单据主", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiParamBillMaster dcBusiParamBillMasterDao)
{
return toAjax(dcBusiParamBillMasterService.updateDcBusiParamBillMasterDao(dcBusiParamBillMasterDao));
@ApiOperation("采集单审核")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@GetMapping("/check/{billNo}")
public AjaxResult checkParamInBill(@PathVariable String billNo){
DcBusiParamBillMaster master=new DcBusiParamBillMaster();
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setBillNo(billNo);
master.setCheckStatus("1");
return AjaxResult.success(dcBusiParamBillMasterService.checkBill(master));
}
/**
* 删除参数采集录入单据主
*/
@PreAuthorize("@ss.hasPermi('param:paramData:remove')")
@Log(title = "参数采集(录入)单据主", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiParamBillMasterService.deleteDcBusiParamBillMasterDaoByIds(ids));
}
}

3
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiParamBillMasterMapper.java

@ -46,6 +46,7 @@ public interface DcBusiParamBillMasterMapper extends BaseMapper<DcBusiParamBillM
* @return 结果
*/
public int updateDcBusiParamBillMasterDao(DcBusiParamBillMaster dcBusiParamBillMasterDao);
public int updateDcBusiParamBillMasterByNo(DcBusiParamBillMaster dcBusiParamBillMasterDao);
/**
* 删除参数采集录入单据主
@ -86,5 +87,5 @@ public interface DcBusiParamBillMasterMapper extends BaseMapper<DcBusiParamBillM
* @param id 参数采集录入单据主ID
* @return 结果
*/
public int deleteDcBusiParamBillSubDaoByBillNo(Long id);
public int deleteDcBusiParamBillSubDaoByBillNo(String billNo);
}

14
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiParamBillMasterService.java

@ -72,11 +72,14 @@ public class DcBusiParamBillMasterService extends ServiceImpl<DcBusiParamBillMas
public int updateDcBusiParamBillMasterDao(DcBusiParamBillMaster dcBusiParamBillMasterDao)
{
dcBusiParamBillMasterDao.setUpdatedTime(DateUtils.getNowDate());
baseMapper.deleteDcBusiParamBillSubDaoByBillNo(dcBusiParamBillMasterDao.getId());
baseMapper.deleteDcBusiParamBillSubDaoByBillNo(dcBusiParamBillMasterDao.getBillNo());
insertDcBusiParamBillSubDao(dcBusiParamBillMasterDao);
return baseMapper.updateDcBusiParamBillMasterDao(dcBusiParamBillMasterDao);
}
public int checkBill(DcBusiParamBillMaster dcBusiParamBillMasterDao)
{
return baseMapper.updateDcBusiParamBillMasterByNo(dcBusiParamBillMasterDao);
}
/**
* 批量删除参数采集录入单据主
*
@ -97,13 +100,6 @@ public class DcBusiParamBillMasterService extends ServiceImpl<DcBusiParamBillMas
* @param id 参数采集录入单据主主键
* @return 结果
*/
@Transactional
public int deleteDcBusiParamBillMasterDaoById(Long id)
{
baseMapper.deleteDcBusiParamBillSubDaoByBillNo(id);
return baseMapper.deleteDcBusiParamBillMasterDaoById(id);
}
/**
* 新增参数数据采集录入明细信息

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

@ -6,7 +6,7 @@
<resultMap type="DcBaseAssetInfo" id="DcBaseAssetInfoResult">
<result property="tenantId" column="TENANT_ID"/>
<result property="REVISION" column="REVISION"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>

2
lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml

@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="com.lzbi.special.domain.DcBaseWorkSpecial" id="DcBaseWorkSpecialResult">
<result property="tenantId" column="TENANT_ID" />
<result property="REVISION" column="REVISION" />
<result property="revision" column="REVISION" />
<result property="createdBy" column="CREATED_BY" />
<result property="createdTime" column="CREATED_TIME" />
<result property="updatedBy" column="UPDATED_BY" />

27
lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml

@ -63,6 +63,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="createdBy != null and createdBy != ''"> and CREATED_BY = #{createdBy}</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>
@ -135,7 +141,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
<update id="updateDcBusiParamBillMasterByNo" parameterType="DcBusiParamBillMaster">
update dc_busi_param_bill_master
<trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">TENANT_ID = #{tenantId},</if>
<if test="revision != null">REVISION = #{revision},</if>
<if test="createdBy != null">CREATED_BY = #{createdBy},</if>
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
<if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
<if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
<if test="deleteBy != null">DELETE_BY = #{deleteBy},</if>
<if test="deleteTime != null">DELETE_TIME = #{deleteTime},</if>
<if test="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>
</trim>
where bill_no = #{billNo}
</update>
<delete id="deleteDcBusiParamBillMasterDaoById" parameterType="Long">
delete from dc_busi_param_bill_master where id = #{id}
</delete>
@ -154,7 +177,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<delete id="deleteDcBusiParamBillSubDaoByBillNo" parameterType="Long">
<delete id="deleteDcBusiParamBillSubDaoByBillNo" parameterType="String">
delete from dc_busi_param_bill_sub where bill_no = #{billNo}
</delete>

15
lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillSubMapper.xml

@ -14,7 +14,8 @@
<!-- 统计单元名称 -->
<result property="assetName" column="asset_name"/>
<!-- 所属专业 -->
<result property="fieldType" column="field_type"/>
<result property="fieldCode" column="field_code"/>
<result property="fieldName" column="field_name"/>
<!-- 指标名称 -->
<result property="paramName" column="param_name"/>
<!-- 指标编码 -->
@ -50,7 +51,8 @@
bill_no,
asset_code,
asset_name,
field_type,
field_code,
field_name,
param_name,
param_code,
param_uint,
@ -74,7 +76,8 @@
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if>
<if test="assetName != null and assetName != ''"> and asset_name = #{assetName}</if>
<if test="fieldType != null and fieldType != ''"> and field_type = #{fieldType}</if>
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if>
<if test="fieldName != null and fieldName != ''"> and field_name = #{fieldName}</if>
<if test="paramName != null and paramName != ''"> and param_name = #{paramName}</if>
<if test="paramCode != null and paramCode != ''"> and param_code = #{paramCode}</if>
<if test="paramUint != null and paramUint != ''"> and param_uint = #{paramUint}</if>
@ -99,7 +102,8 @@
<if test="billNo != null and billNo != ''">bill_no,</if>
<if test="assetCode != null and assetCode != ''">asset_code,</if>
<if test="assetName != null and assetName != ''">asset_name,</if>
<if test="fieldType != null and fieldType != ''">field_type,</if>
<if test="fieldCode != null and fieldCode != ''">field_code,</if>
<if test="fieldName != null and fieldName != ''">field_name,</if>
<if test="paramName != null and paramName != ''">param_name,</if>
<if test="paramCode != null and paramCode != ''">param_code,</if>
<if test="paramUint != null and paramUint != ''">param_uint,</if>
@ -120,7 +124,8 @@
<if test="billNo != null and billNo != ''">#{billNo},</if>
<if test="assetCode != null and assetCode != ''">#{assetCode},</if>
<if test="assetName != null and assetName != ''">#{assetName},</if>
<if test="fieldType != null and fieldType != ''">#{fieldType},</if>
<if test="fieldCode != null and fieldCode != ''">#{fieldCode},</if>
<if test="fieldName != null and fieldName != ''">#{fieldName},</if>
<if test="paramName != null and paramName != ''">#{paramName},</if>
<if test="paramCode != null and paramCode != ''">#{paramCode},</if>
<if test="paramUint != null and paramUint != ''">#{paramUint},</if>

Loading…
Cancel
Save