@ -10,6 +10,7 @@ import com.lzbi.code.service.DcBaseCoderuleDefineService;
import com.lzbi.common.annotation.Log ;
import com.lzbi.common.annotation.Log ;
import com.lzbi.common.core.controller.BaseController ;
import com.lzbi.common.core.controller.BaseController ;
import com.lzbi.common.core.domain.AjaxResult ;
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.domain.model.LoginUser ;
import com.lzbi.common.core.page.TableDataInfo ;
import com.lzbi.common.core.page.TableDataInfo ;
import com.lzbi.common.enums.BusinessType ;
import com.lzbi.common.enums.BusinessType ;
@ -22,6 +23,7 @@ import com.lzbi.draft.domain.DcBusiParamBillMaster;
import com.lzbi.draft.domain.DcBusiParamBillSub ;
import com.lzbi.draft.domain.DcBusiParamBillSub ;
import com.lzbi.draft.service.DcBusiBillModelMasterService ;
import com.lzbi.draft.service.DcBusiBillModelMasterService ;
import com.lzbi.draft.service.DcBusiParamBillMasterService ;
import com.lzbi.draft.service.DcBusiParamBillMasterService ;
import com.lzbi.system.service.ISysDeptService ;
import io.swagger.annotations.ApiImplicitParam ;
import io.swagger.annotations.ApiImplicitParam ;
import io.swagger.annotations.ApiImplicitParams ;
import io.swagger.annotations.ApiImplicitParams ;
import io.swagger.annotations.ApiOperation ;
import io.swagger.annotations.ApiOperation ;
@ -53,6 +55,8 @@ public class DcBusiParamCollectBill extends BaseController
private DcBaseCoderuleDefineService dcBaseCoderuleDefineService ;
private DcBaseCoderuleDefineService dcBaseCoderuleDefineService ;
@Autowired
@Autowired
private CodeNoGenerater codeNoGenerater ;
private CodeNoGenerater codeNoGenerater ;
@Autowired
private ISysDeptService sysDeptService ;
/ * *
/ * *
* 查询参数采集 ( 录入 )
* 查询参数采集 ( 录入 )
* 根据
* 根据
@ -87,6 +91,13 @@ public class DcBusiParamCollectBill extends BaseController
List < DcBusiBillModelMaster > list = dcBusiBillModelMasterService . selectDcBusiBillModelMasterList ( dcBusiBillModelMaster ) ;
List < DcBusiBillModelMaster > list = dcBusiBillModelMasterService . selectDcBusiBillModelMasterList ( dcBusiBillModelMaster ) ;
return getDataTable ( list ) ;
return getDataTable ( list ) ;
}
}
@GetMapping ( "/userModelById/{mid}" )
public AjaxResult getUserModelById ( @PathVariable Long mid )
{
DcBusiBillModelMaster dcBusiBillModelMaster = dcBusiBillModelMasterService . selectDcBusiBillModelMasterById ( mid ) ;
return AjaxResult . success ( dcBusiBillModelMaster ) ;
}
/ * *
/ * *
* 根据根据公司查询模版 , 现根据角色ID进行过滤
* 根据根据公司查询模版 , 现根据角色ID进行过滤
* 根据
* 根据
@ -130,27 +141,33 @@ public class DcBusiParamCollectBill extends BaseController
dcBusiBillModelMaster . setBillModelPoint ( dcBusiParamBillMaster . getCountTimes ( ) ) ;
dcBusiBillModelMaster . setBillModelPoint ( dcBusiParamBillMaster . getCountTimes ( ) ) ;
dcBusiBillModelMaster . setRoleId ( loginUser . getUser ( ) . getRoleId ( ) ) ;
dcBusiBillModelMaster . setRoleId ( loginUser . getUser ( ) . getRoleId ( ) ) ;
dcBusiBillModelMaster . setDeptId ( loginUser . getDeptId ( ) ) ;
dcBusiBillModelMaster . setDeptId ( loginUser . getDeptId ( ) ) ;
dcBusiBillModelMaster . setCompanyId ( dcBusiParamBillMaster . getCompanyId ( ) ) ;
long deptId = dcBusiParamBillMaster . getCompanyId ( ) ;
dcBusiBillModelMaster . setCompanyName ( dcBusiParamBillMaster . getCompanyName ( ) ) ;
SysDept sysDept = Optional . ofNullable ( sysDeptService . selectDeptById ( deptId ) ) . orElse ( new SysDept ( ) ) ;
dcBusiBillModelMaster . setOrgId ( dcBusiParamBillMaster . getOragnizeId ( ) ) ;
dcBusiBillModelMaster . setCompanyId ( deptId ) ;
dcBusiBillModelMaster . setOrgName ( dcBusiBillModelMaster . getOrgName ( ) ) ;
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 . setDataState ( "0" ) ;
dcBusiBillModelMaster . setUseState ( "1" ) ;
dcBusiBillModelMaster . setUseState ( "1" ) ;
dcBusiBillModelMaster . setFieldCode ( dcBusiParamBillMaster . getFieldCode ( ) ) ;
dcBusiBillModelMaster . setFieldCode ( dcBusiParamBillMaster . getFieldCode ( ) ) ;
dcBusiBillModelMaster . setFieldName ( dcBusiParamBillMaster . getFieldName ( ) ) ;
dcBusiBillModelMaster . setFieldName ( dcBusiParamBillMaster . getFieldName ( ) ) ;
dcBusiBillModelMaster . setBillModelNo ( billModelNo ) ;
dcBusiBillModelMaster . setBillModelNo ( billModelNo ) ;
dcBusiBillModelMaster . setBillModelName ( dcBusiParamBillMaster . getBillName ( ) ) ;
dcBusiBillModelMaster . setBillModelName ( dcBusiParamBillMaster . getBii lMode lName ( ) ) ;
List < DcBusiBillModelSub > dcBusiBillModelSubList = new ArrayList < > ( ) ;
List < DcBusiBillModelSub > dcBusiBillModelSubList = new ArrayList < > ( ) ;
List < DcBusiParamBillSub > dcBusiParamBillSubList = dcBusiParamBillMaster . getDcBusiParamBillSubList ( ) ;
JSONArray jsonArray = Optional . ofNullable ( JSONArray . from ( dcBusiParamBillMaster . getSubDatas ( ) ) ) . orElse ( new JSONArray ( ) ) ;
dcBusiParamBillSubList . forEach ( item - > {
jsonArray . forEach ( item - > {
JSONObject jsb = JSONObject . from ( item ) ;
DcBusiBillModelSub modelSub = new DcBusiBillModelSub ( ) ;
DcBusiBillModelSub modelSub = new DcBusiBillModelSub ( ) ;
modelSub . setBillModelNo ( billModelNo ) ;
modelSub . setBillModelNo ( billModelNo ) ;
modelSub . setAssetCode ( item . getAssetCode ( ) ) ;
modelSub . setAssetCode ( jsb . getString ( "assetCode" ) ) ;
modelSub . setAssetName ( item . getAssetName ( ) ) ;
modelSub . setAssetName ( jsb . getString ( "assetName" ) ) ;
//modelSub.setAssetId(item.get);
//modelSub.setAssetId(item.get);
modelSub . setAssetUnitCode ( item . getParamCode ( ) ) ;
modelSub . setAssetUnitCode ( jsb . getString ( "paramCode" ) ) ;
modelSub . setAssetUnitName ( item . getParamName ( ) ) ;
modelSub . setAssetUnitName ( jsb . getString ( "paramName" ) ) ;
modelSub . setAssetUnitType ( "P" ) ;
modelSub . setAssetUnitType ( "P" ) ;
modelSub . setAUnit ( jsb . getString ( "paramUint" ) ) ;
dcBusiBillModelSubList . add ( modelSub ) ;
dcBusiBillModelSubList . add ( modelSub ) ;
} ) ;
} ) ;
dcBusiBillModelMaster . setDcBusiBillModelSubList ( dcBusiBillModelSubList ) ;
dcBusiBillModelMaster . setDcBusiBillModelSubList ( dcBusiBillModelSubList ) ;
@ -211,7 +228,8 @@ public class DcBusiParamCollectBill extends BaseController
return AjaxResult . success ( dcBusiParamBillMasterService . insertDcBusiParamBillMasterDao ( dcBusiParamBillMaster ) ) ;
return AjaxResult . success ( dcBusiParamBillMasterService . insertDcBusiParamBillMasterDao ( dcBusiParamBillMaster ) ) ;
}
}
private String getBillModelNo ( ) {
private String getBillModelNo ( ) {
DcBusiCoderuleConfigDao ruleIdByBusicode = dcBaseCoderuleDefineService . getRuleIdByBusicode ( "BILL_MODEL_NO" ) ;
DcBusiCoderuleConfigDao ruleIdByBusicode = Optional . ofNullable ( dcBaseCoderuleDefineService . getRuleIdByBusicode ( "BILL_MODEL_NO" ) ) . orElse ( new DcBusiCoderuleConfigDao ( ) ) ;
DcBaseCoderuleDefineDao ruleDao = dcBaseCoderuleDefineService . selectDcBaseCoderuleDefineDaoById ( ruleIdByBusicode . getRuleId ( ) ) ;
DcBaseCoderuleDefineDao ruleDao = dcBaseCoderuleDefineService . selectDcBaseCoderuleDefineDaoById ( ruleIdByBusicode . getRuleId ( ) ) ;
return codeNoGenerater . getCode ( ruleDao ) ;
return codeNoGenerater . getCode ( ruleDao ) ;
}
}