| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.bean.dto.UserAccountDto; |
| | | import com.ruoyi.production.bean.dto.UserProductionAccountingDto; |
| | | import com.ruoyi.production.service.SalesLedgerProductionAccountingService; |
| | |
| | | |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, SchemeApplicableStaff schemeApplicableStaff) { |
| | | public R<?> listPage(Page page, SchemeApplicableStaff schemeApplicableStaff) { |
| | | LambdaQueryWrapper<SchemeApplicableStaff> schemeApplicableStaffLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(schemeApplicableStaff != null){ |
| | | if(StringUtils.isNotEmpty(schemeApplicableStaff.getTitle())){ |
| | |
| | | Page<SchemeApplicableStaff> page1 = schemeApplicableStaffMapper.selectPage(page, schemeApplicableStaffLambdaQueryWrapper); |
| | | List<Long> collect = page1.getRecords().stream().map(SchemeApplicableStaff::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(collect)){ |
| | | return AjaxResult.success(page1); |
| | | return R.ok(page1); |
| | | } |
| | | List<SchemeInsuranceDetail> schemeInsuranceDetails = schemeInsuranceDetailMapper |
| | | .selectList(new LambdaQueryWrapper<SchemeInsuranceDetail>() |
| | |
| | | item.setDeptNames(sysDepts.stream().map(SysDept::getDeptName).collect(Collectors.joining(","))); |
| | | } |
| | | }); |
| | | return AjaxResult.success(page1); |
| | | return R.ok(page1); |
| | | } |
| | | |
| | | public void setSchemeApplicableStaffUserInfo(SchemeApplicableStaff schemeApplicableStaff) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult add(SchemeApplicableStaff schemeApplicableStaff) { |
| | | public R<?> add(SchemeApplicableStaff schemeApplicableStaff) { |
| | | if(schemeApplicableStaff == null){ |
| | | return AjaxResult.error("参数错误"); |
| | | return R.fail("参数错误"); |
| | | } |
| | | if(CollectionUtils.isEmpty(schemeApplicableStaff.getSchemeInsuranceDetailList())){ |
| | | return AjaxResult.error("请选择方案明细"); |
| | | return R.fail("请选择方案明细"); |
| | | } |
| | | setSchemeApplicableStaffUserInfo(schemeApplicableStaff); //根据部门设置用户信息 |
| | | int insert = schemeApplicableStaffMapper.insert(schemeApplicableStaff); |
| | |
| | | item.setSchemeId(schemeApplicableStaff.getId()); |
| | | schemeInsuranceDetailMapper.insert(item); |
| | | }); |
| | | return AjaxResult.success(insert); |
| | | return R.ok(insert); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateSchemeApplicableStaff(SchemeApplicableStaff schemeApplicableStaff) { |
| | | public R<?> updateSchemeApplicableStaff(SchemeApplicableStaff schemeApplicableStaff) { |
| | | if(schemeApplicableStaff == null){ |
| | | return AjaxResult.error("参数错误"); |
| | | return R.fail("参数错误"); |
| | | } |
| | | setSchemeApplicableStaffUserInfo(schemeApplicableStaff); //根据部门设置用户信息 |
| | | int update = schemeApplicableStaffMapper.updateById(schemeApplicableStaff); |
| | |
| | | item.setSchemeId(schemeApplicableStaff.getId()); |
| | | schemeInsuranceDetailMapper.insert(item); |
| | | }); |
| | | return AjaxResult.success(update); |
| | | return R.ok(update); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult delete(List<Long> ids) { |
| | | public R<?> delete(List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return AjaxResult.error("参数错误"); |
| | | return R.fail("参数错误"); |
| | | } |
| | | int delete = schemeApplicableStaffMapper.deleteBatchIds(ids); |
| | | schemeInsuranceDetailMapper.delete(new LambdaQueryWrapper<SchemeInsuranceDetail>() |
| | | .in(SchemeInsuranceDetail::getSchemeId, ids)); |
| | | return AjaxResult.success(delete); |
| | | return R.ok(delete); |
| | | } |
| | | |
| | | /** |