bug-6674-改食堂区域时同时改档口区域
This commit is contained in:
parent
b979ccbc97
commit
ca6db30a52
|
|
@ -46,6 +46,8 @@ public interface BasicStallMapper {
|
|||
*/
|
||||
public int updateBasicStall(BasicStall basicStall);
|
||||
|
||||
public int updateStallToNewAreaId(BasicStall basicStall);
|
||||
|
||||
/**
|
||||
* 删除档口信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.bonus.canteen.core.basic.domain.BasicStall;
|
||||
import com.bonus.canteen.core.basic.mapper.BasicStallMapper;
|
||||
import com.bonus.canteen.core.utils.BnsConstants;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
|
|
@ -90,7 +91,13 @@ public class BasicCanteenServiceImpl implements IBasicCanteenService {
|
|||
if (otherCanteenNameList.contains(basicCanteen.getCanteenName())) {
|
||||
throw new ServiceException("该区域食堂名称已存在");
|
||||
}
|
||||
return basicCanteenMapper.updateBasicCanteen(basicCanteen);
|
||||
int count = basicCanteenMapper.updateBasicCanteen(basicCanteen);
|
||||
//食堂更换区域id时,同时更换档口区域id
|
||||
BasicStall basicStall = new BasicStall();
|
||||
basicStall.setAreaId(basicCanteen.getAreaId());
|
||||
basicStall.setCanteenId(basicCanteen.getCanteenId());
|
||||
basicStallMapper.updateStallToNewAreaId(basicStall);
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,6 +159,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where stall_id = #{stallId}
|
||||
</update>
|
||||
|
||||
<update id="updateStallToNewAreaId" parameterType="com.bonus.canteen.core.basic.domain.BasicStall">
|
||||
update basic_stall set area_id = #{areaId}
|
||||
where canteen_id = #{canteenId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasicStallByStallId" parameterType="Long">
|
||||
update basic_stall set del_flag = '2' where stall_id = #{stallId}
|
||||
</delete>
|
||||
|
|
|
|||
Loading…
Reference in New Issue