Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
liang.chao 2024-01-12 17:07:37 +08:00
commit 43c5f53816
8 changed files with 43 additions and 9 deletions

View File

@ -97,7 +97,7 @@ public class AgreementInfoController extends BaseController {
@PostMapping("/remove")
public AjaxResult deleteByIds(@Validated @RequestBody AgreementInfo bean)
{
return toAjax(agreementInfoService.deleteByIds(bean));
return agreementInfoService.deleteByIds(bean);
}

View File

@ -31,9 +31,9 @@ public class ReturnOfMaterialsInfoController extends BaseController {
private ReturnOfMaterialsInfoService returnOfMaterialsInfoService;
/**
* 获取协议管理列表
* 获取机具退料入库列表
*/
@ApiOperation(value = "获取协议管理列表")
@ApiOperation(value = "获取机具退料入库列表")
@GetMapping("/getReturnOfMaterialsInfoAll")
public TableDataInfo getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean)
{

View File

@ -194,5 +194,9 @@ public class BackApplyInfo extends BaseEntity {
private String guigeCn;
private String preNum;
private String typeCn;
/** 前端条件查询所传工程id */
private String proId;
/** 前端条件查询所传退料时间 */
private String time;
}

View File

@ -29,4 +29,6 @@ public interface AgreementInfoMapper {
AgreementInfo getAgreementInfoId(AgreementInfo bean);
List<AgreementInfo> getInfo(AgreementInfo bean);
int selectByagreementId(Long agreementId);
}

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.service;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.material.domain.AgreementInfo;
import java.util.List;
@ -19,7 +20,7 @@ public interface AgreementInfoService {
int update(AgreementInfo bean);
int deleteByIds(AgreementInfo bean);
AjaxResult deleteByIds(AgreementInfo bean);
AgreementInfo getAgreementInfoId(AgreementInfo bean);

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.common.core.utils.StringHelper;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.material.domain.AgreementInfo;
import com.bonus.sgzb.material.mapper.AgreementInfoMapper;
@ -56,8 +57,23 @@ public class AgreementInfoServiceImpl implements AgreementInfoService {
}
@Override
public int deleteByIds(AgreementInfo bean) {
return agreementInfoMapper.deleteByIds(bean);
public AjaxResult deleteByIds(AgreementInfo bean) {
if (bean.getAgreementId()!=null){
//查询该协议是否存在领料任务有的话不能删除
int res=agreementInfoMapper.selectByagreementId(bean.getAgreementId());
if (res>0){
return AjaxResult.error("该协议已产生领料数据,不可删除");
}else {
int re = agreementInfoMapper.deleteByIds(bean);
if (re>0){
return AjaxResult.success("操作成功");
}else {
return AjaxResult.error("操作失败");
}
}
}else {
return AjaxResult.error("协议数据为空");
}
}
@Override

View File

@ -144,4 +144,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE status = '1' and unit_id = #{unitId} AND project_id = #{projectId}
</select>
<select id="selectByagreementId" resultType="java.lang.Integer">
SELECT
COUNT(*)
FROM
tm_task_agreement tta
WHERE
tta.agreement_id=#{agreementId}
</select>
</mapper>

View File

@ -316,15 +316,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lotId != null and lotId != ''">
and bpl.lot_id = #{lotId}
</if>
<if test="proId != null and proId != ''">
and bpl.lot_id = #{proId}
</if>
<if test="taskStatus != null and taskStatus != ''">
and tt.task_status = #{taskStatus}
</if>
<if test="agreementCode != null and agreementCode != ''">
and bagi.agreement_code like concat('%', #{agreementCode}, '%')
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and bai.back_time >=#{startTime}
and #{endTime} >=bai.back_time
<if test="time != null and time != ''">
and bai.back_time =#{time}
</if>
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
ORDER BY bai.create_time desc