Commit faf44f43c91fa727289d42b84bf873e494f60d6e
1 parent
48d04c07
盘点明细删除
Showing
3 changed files
with
46 additions
and
17 deletions
.idea/WMSV1.iml deleted
1 | -<?xml version="1.0" encoding="UTF-8"?> | |
2 | -<module type="JAVA_MODULE" version="4"> | |
3 | - <component name="FacetManager"> | |
4 | - <facet type="Spring" name="Spring"> | |
5 | - <configuration /> | |
6 | - </facet> | |
7 | - <facet type="web" name="Web"> | |
8 | - <configuration> | |
9 | - <webroots /> | |
10 | - <sourceRoots> | |
11 | - <root url="file://$MODULE_DIR$/src/main/java" /> | |
12 | - <root url="file://$MODULE_DIR$/src/main/resources" /> | |
13 | - </sourceRoots> | |
14 | - </configuration> | |
15 | - </facet> | |
16 | - </component> | |
17 | -</module> | |
18 | 0 | \ No newline at end of file |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
... | ... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | +import com.huaheng.common.support.Convert; | |
7 | 8 | import com.huaheng.common.utils.StringUtils; |
8 | 9 | import com.huaheng.common.utils.security.ShiroUtils; |
9 | 10 | import com.huaheng.framework.aspectj.lang.annotation.Log; |
... | ... | @@ -146,6 +147,50 @@ public class CycleCountDetailController extends BaseController { |
146 | 147 | return cycleCountDetailService.addDetails(cycleCountHeadId,inventoryDetailIdIds); |
147 | 148 | } |
148 | 149 | |
150 | + /** | |
151 | + * 删除盘点明细 | |
152 | + */ | |
153 | + //@RequiresPermissions("inventory:cyclecountDetail:remove") | |
154 | + @Log(title = "库存-盘点", operating = "删除盘点明细", action = BusinessType.DELETE) | |
155 | + @PostMapping( "/remove") | |
156 | + @ResponseBody | |
157 | + public AjaxResult remove(String ids){ | |
158 | + | |
159 | + if (StringUtils.isEmpty(ids)) | |
160 | + return AjaxResult.error("删除的明细id不能为空"); | |
161 | + Integer[] detailsIds = Convert.toIntArray(ids); | |
162 | + CycleCountDetail cyclecountDetail = cycleCountDetailService.getById(detailsIds[0]); | |
163 | + CycleCountHeader cyclecountHeader = cycleCountHeaderService.getById(cyclecountDetail.getCycleCountHeadId()); | |
164 | + if(cyclecountHeader==null){ | |
165 | + return AjaxResult.error("主单据不存在"); | |
166 | + } | |
167 | + if(cyclecountHeader.getStatusCyc() > 29){ | |
168 | + return AjaxResult.error("主单据状态不允许删除"); | |
169 | + } | |
170 | + for (Integer id : detailsIds) | |
171 | + { | |
172 | + //只允许删除新建状态下的盘点明细。 | |
173 | + CycleCountDetail cyclecountDetailFor = cycleCountDetailService.getById(id); | |
174 | + if(cyclecountDetailFor.getEnableStatus() > 1){ | |
175 | + return AjaxResult.error("盘点已开始执行,不允许删除该盘点明细!"); | |
176 | + } | |
177 | + cycleCountDetailService.removeById(id); | |
178 | + } | |
179 | + return AjaxResult.success("删除成功!"); | |
180 | + } | |
181 | + | |
182 | + | |
183 | + | |
184 | + | |
185 | + | |
186 | + | |
187 | + | |
188 | + | |
189 | + | |
190 | + | |
191 | + | |
192 | + | |
193 | + | |
149 | 194 | |
150 | 195 | |
151 | 196 | |
... | ... |