skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/controller/SgGxController.java
@@ -62,4 +62,13 @@ SgGxVO sgGxDO = sgGxService.detail(id); return R.data(sgGxDO); } /** * 删除 */ @GetMapping(value = "/delete") public R delete(Long id) { sgGxService.delete(id); return R.success("删除成功"); } } skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectInfoMapper.xml
@@ -49,9 +49,10 @@ <select id="progressList" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> SELECT pro.id, pro.project_name pro.project_name, pro.lon_lat FROM ywxt.sg_project_info pro ywxt.sg_project_info pro where 1=1 <if test="dto.status != null"> and pro.status = #{dto.status} </if> skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/SgGxService.java
@@ -23,4 +23,6 @@ void update(SgGxDO sgGxDO); SgGxVO detail(Long id); void delete(Long id); } skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgGxServiceImpl.java
@@ -6,14 +6,17 @@ import cn.gistack.sm.sg.DTO.ProjectSearchDTO; import cn.gistack.sm.sg.VO.SgGxVO; import cn.gistack.sm.sg.mapper.SgGxMapper; import cn.gistack.sm.sg.mapper.SgGxStepMapper; import cn.gistack.sm.sg.mapper.SgProgressReportMapper; import cn.gistack.sm.sg.service.SgGxService; import cn.gistack.sm.sg.service.SgGxStepService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.core.log.exception.ServiceException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -31,6 +34,12 @@ public class SgGxServiceImpl extends ServiceImpl<SgGxMapper, SgGxDO> implements SgGxService { @Autowired private SgGxMapper sgGxMapper; @Autowired private SgGxStepMapper sgGxStepMapper; @Autowired private SgGxStepService sgGxStepService; @Autowired private SgProgressReportMapper sgProgressReportMapper; @@ -87,4 +96,11 @@ byId.setStepDOList(stepDOS); return byId; } @Override @Transactional public void delete(Long id) { SgGxDO byId = this.getById(id); this.delete(id); } } skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgGxStepServiceImpl.java
@@ -9,6 +9,7 @@ import cn.gistack.sm.sg.service.SgGxStepService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import org.springblade.core.log.exception.ServiceException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -51,6 +52,9 @@ @Override public void delete(String id) { SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(id); if (!new LambdaQueryChainWrapper<>(sgGxRoleMapper).eq(SgGxRoleDO::getGxStepId,id).list().isEmpty()){ throw new ServiceException(sgGxStepDO.getGxStepName()+ "已绑定角色,无法删除"); } List<SgGxStepDO> list= sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId()); if (!sgGxStepDO.getGxStepNum().equals(list.get(0).getGxStepNum())){ throw new ServiceException("请按顺序删除工序步骤"); skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgProjectInfoServiceImpl.java
@@ -192,11 +192,12 @@ List<SgProjectInfoVO> progressList = progressList(searchDTO); BigDecimal reduce = progressList.stream().map(SgProjectInfoDO::getProjectProgressNum).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal divide = reduce.divide(BigDecimal.valueOf(progressList.size()), 2, RoundingMode.HALF_UP); map.put("all", list.size()); map.put("pending", pending.size()); map.put("progress", progress.size()); map.put("over", over.size()); map.put("projectProgress", getBigDecimalPercent(reduce)); map.put("projectProgress", getBigDecimalPercent(divide)); return map; }