功能优化
This commit is contained in:
parent
db86f585c0
commit
2e2bc51b31
|
|
@ -97,7 +97,7 @@ public class AgreementInfoController extends BaseController {
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
public AjaxResult deleteByIds(@Validated @RequestBody AgreementInfo bean)
|
public AjaxResult deleteByIds(@Validated @RequestBody AgreementInfo bean)
|
||||||
{
|
{
|
||||||
return toAjax(agreementInfoService.deleteByIds(bean));
|
return agreementInfoService.deleteByIds(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ public class ReturnOfMaterialsInfoController extends BaseController {
|
||||||
private ReturnOfMaterialsInfoService returnOfMaterialsInfoService;
|
private ReturnOfMaterialsInfoService returnOfMaterialsInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取协议管理列表
|
* 获取机具退料入库列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取协议管理列表")
|
@ApiOperation(value = "获取机具退料入库列表")
|
||||||
@GetMapping("/getReturnOfMaterialsInfoAll")
|
@GetMapping("/getReturnOfMaterialsInfoAll")
|
||||||
public TableDataInfo getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean)
|
public TableDataInfo getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -194,5 +194,9 @@ public class BackApplyInfo extends BaseEntity {
|
||||||
private String guigeCn;
|
private String guigeCn;
|
||||||
private String preNum;
|
private String preNum;
|
||||||
private String typeCn;
|
private String typeCn;
|
||||||
|
/** 前端条件查询所传工程id */
|
||||||
|
private String proId;
|
||||||
|
/** 前端条件查询所传退料时间 */
|
||||||
|
private String time;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,6 @@ public interface AgreementInfoMapper {
|
||||||
AgreementInfo getAgreementInfoId(AgreementInfo bean);
|
AgreementInfo getAgreementInfoId(AgreementInfo bean);
|
||||||
|
|
||||||
List<AgreementInfo> getInfo(AgreementInfo bean);
|
List<AgreementInfo> getInfo(AgreementInfo bean);
|
||||||
|
|
||||||
|
int selectByagreementId(Long agreementId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.sgzb.material.service;
|
package com.bonus.sgzb.material.service;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -19,7 +20,7 @@ public interface AgreementInfoService {
|
||||||
|
|
||||||
int update(AgreementInfo bean);
|
int update(AgreementInfo bean);
|
||||||
|
|
||||||
int deleteByIds(AgreementInfo bean);
|
AjaxResult deleteByIds(AgreementInfo bean);
|
||||||
|
|
||||||
AgreementInfo getAgreementInfoId(AgreementInfo bean);
|
AgreementInfo getAgreementInfoId(AgreementInfo bean);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.sgzb.material.service.impl;
|
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.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||||
import com.bonus.sgzb.material.mapper.AgreementInfoMapper;
|
import com.bonus.sgzb.material.mapper.AgreementInfoMapper;
|
||||||
|
|
@ -56,8 +57,23 @@ public class AgreementInfoServiceImpl implements AgreementInfoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int deleteByIds(AgreementInfo bean) {
|
public AjaxResult deleteByIds(AgreementInfo bean) {
|
||||||
return agreementInfoMapper.deleteByIds(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
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -144,4 +144,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE status = '1' and unit_id = #{unitId} AND project_id = #{projectId}
|
WHERE status = '1' and unit_id = #{unitId} AND project_id = #{projectId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByagreementId" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
COUNT(*)
|
||||||
|
FROM
|
||||||
|
tm_task_agreement tta
|
||||||
|
WHERE
|
||||||
|
tta.agreement_id=#{agreementId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -316,15 +316,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="lotId != null and lotId != ''">
|
<if test="lotId != null and lotId != ''">
|
||||||
and bpl.lot_id = #{lotId}
|
and bpl.lot_id = #{lotId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="proId != null and proId != ''">
|
||||||
|
and bpl.lot_id = #{proId}
|
||||||
|
</if>
|
||||||
<if test="taskStatus != null and taskStatus != ''">
|
<if test="taskStatus != null and taskStatus != ''">
|
||||||
and tt.task_status = #{taskStatus}
|
and tt.task_status = #{taskStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="agreementCode != null and agreementCode != ''">
|
<if test="agreementCode != null and agreementCode != ''">
|
||||||
and bagi.agreement_code like concat('%', #{agreementCode}, '%')
|
and bagi.agreement_code like concat('%', #{agreementCode}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<if test="time != null and time != ''">
|
||||||
and bai.back_time >=#{startTime}
|
and bai.back_time =#{time}
|
||||||
and #{endTime} >=bai.back_time
|
|
||||||
</if>
|
</if>
|
||||||
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
|
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
|
ORDER BY bai.create_time desc
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue