仓库修改寄售功能代码提交

master
郑明梁 3 years ago
parent ac92524ae9
commit b19aa2581e

@ -245,6 +245,18 @@ public class InvWarehouseController extends BaseController {
invWarehouseEntity.setUpdateTime(new Date()); invWarehouseEntity.setUpdateTime(new Date());
boolean b = invWarehouseService.updateInvSubWarehouse(invWarehouseEntity); boolean b = invWarehouseService.updateInvSubWarehouse(invWarehouseEntity);
//如果要是一级仓库就吧全部子集都刷成一样的寄售仓库
if(StrUtil.isBlank(invWarehouseEntity.getParentCode())){
List<InvWarehouseEntity> invWarehouseEntityList=invWarehouseService.selectLowWarehouseAll(invWarehouseEntity.getCode());
for (InvWarehouseEntity obj : invWarehouseEntityList) {
obj.setAdvanceType(invWarehouseEntity.getAdvanceType());
obj.setUpdateTime(new Date());
invWarehouseService.updateInvSubWarehouse(obj);
}
}
//更新部门信息 //更新部门信息
DeptEntity pEntity = deptService.selectByCode(invWarehouseEntity.getParentId()); DeptEntity pEntity = deptService.selectByCode(invWarehouseEntity.getParentId());
pEntity.setUpdateTime(new Date()); pEntity.setUpdateTime(new Date());

@ -1,6 +1,7 @@
package com.glxp.api.dao.auth; package com.glxp.api.dao.auth;
import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.auth.DeptEntity;
import com.glxp.api.entity.auth.InvWarehouseEntity; import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.req.auth.FilterInvSubWarehouseRequest; import com.glxp.api.req.auth.FilterInvSubWarehouseRequest;
import com.glxp.api.req.auth.FilterInvWarehouseRequest; import com.glxp.api.req.auth.FilterInvWarehouseRequest;
@ -105,4 +106,6 @@ public interface InvWarehouseDao extends BaseMapperPlus<InvWarehouseDao, InvWare
*/ */
InvWarehouseEntity filterInvSubWarehouseLimitOne(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest); InvWarehouseEntity filterInvSubWarehouseLimitOne(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest);
List<InvWarehouseEntity> selectLowWarehouseAll(@Param("pcode") String pCode);
} }

@ -1,5 +1,6 @@
package com.glxp.api.service.auth; package com.glxp.api.service.auth;
import com.glxp.api.entity.auth.DeptEntity;
import com.glxp.api.entity.auth.InvWarehouseEntity; import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.req.auth.FilterInvSubWarehouseRequest; import com.glxp.api.req.auth.FilterInvSubWarehouseRequest;
import com.glxp.api.req.auth.FilterInvWarehouseRequest; import com.glxp.api.req.auth.FilterInvWarehouseRequest;
@ -85,4 +86,7 @@ public interface InvWarehouseService {
String selectParentIdByCode( String invCode); String selectParentIdByCode( String invCode);
List<InvWarehouseEntity> selectInvById(List<String> InvList); List<InvWarehouseEntity> selectInvById(List<String> InvList);
List<InvWarehouseEntity> selectLowWarehouseAll(String pCode);
} }

@ -233,4 +233,9 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
public List<InvWarehouseEntity> selectInvById(List<String> InvList) { public List<InvWarehouseEntity> selectInvById(List<String> InvList) {
return invWarehouseDao.selectInvById(InvList); return invWarehouseDao.selectInvById(InvList);
} }
@Override
public List<InvWarehouseEntity> selectLowWarehouseAll(String pCode) {
return invWarehouseDao.selectLowWarehouseAll(pCode);
}
} }

@ -421,4 +421,14 @@
</where> </where>
limit 1 limit 1
</select> </select>
<select id="selectLowWarehouseAll" parameterType="java.lang.String" resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
with recursive table_a as (
select * from auth_warehouse ta where parentCode = #{pcode}
union all
select tb.* from auth_warehouse tb inner join table_a on table_a.code = tb.parentCode
)
select * from table_a
</select>
</mapper> </mapper>

Loading…
Cancel
Save