|
|
@ -6,16 +6,21 @@ import com.ruoyi.ck.utils.Result; |
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept; |
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser; |
|
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
|
import com.ruoyi.erp.domain.ErpMaterialVo; |
|
|
|
import com.ruoyi.system.domain.SysMakeorderBom; |
|
|
|
import com.ruoyi.system.domain.SysPost; |
|
|
|
import com.ruoyi.system.mapper.SysDeptMapper; |
|
|
|
import com.ruoyi.system.mapper.SysMakeorderBomMapper; |
|
|
|
import com.ruoyi.system.service.ISysDeptService; |
|
|
|
import com.ruoyi.warehouse.domain.VO.WarehouseMaterialVO; |
|
|
|
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamageChild; |
|
|
|
import com.ruoyi.warehouse.mapper.WarehouseInventoryReportDamageChildMapper; |
|
|
|
import com.ruoyi.warehouse.service.IWarehouseInventoryReportDamageChildService; |
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.ui.ModelMap; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import com.ruoyi.common.annotation.Log; |
|
|
|
import com.ruoyi.common.enums.BusinessType; |
|
|
@ -49,6 +54,12 @@ public class WarehouseInventoryReportDamageController extends BaseController |
|
|
|
@Autowired |
|
|
|
private SysMakeorderBomMapper sysMakeorderBomMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IWarehouseInventoryReportDamageChildService damageChildService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WarehouseInventoryReportDamageChildMapper damageChildMapper; |
|
|
|
|
|
|
|
@RequiresPermissions("warehouse:inventoryReportDamage:view") |
|
|
|
@GetMapping() |
|
|
|
public String inventoryReportDamage() |
|
|
@ -76,11 +87,19 @@ public class WarehouseInventoryReportDamageController extends BaseController |
|
|
|
@Log(title = "仓库库存报损", businessType = BusinessType.EXPORT) |
|
|
|
@PostMapping("/export") |
|
|
|
@ResponseBody |
|
|
|
public AjaxResult export(WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|
|
|
{ |
|
|
|
List<WarehouseInventoryReportDamage> list = warehouseInventoryReportDamageService.selectWarehouseInventoryReportDamageList(warehouseInventoryReportDamage); |
|
|
|
ExcelUtil<WarehouseInventoryReportDamage> util = new ExcelUtil<WarehouseInventoryReportDamage>(WarehouseInventoryReportDamage.class); |
|
|
|
return util.exportExcel(list, "仓库库存报损数据"); |
|
|
|
public AjaxResult export(WarehouseInventoryReportDamage warehouseInventoryReportDamage, String ids) { |
|
|
|
|
|
|
|
if (StringUtils.isEmpty(ids)){ |
|
|
|
WarehouseInventoryReportDamageChild damageChild = new WarehouseInventoryReportDamageChild(); |
|
|
|
List<WarehouseInventoryReportDamageChild> list = damageChildService.selectWarehouseInventoryReportDamageChildList(damageChild); |
|
|
|
ExcelUtil<WarehouseInventoryReportDamageChild> util = new ExcelUtil<WarehouseInventoryReportDamageChild>(WarehouseInventoryReportDamageChild.class); |
|
|
|
return util.exportExcel(list, "仓库库存报损数据"); |
|
|
|
}else { |
|
|
|
String[] damageCodes = ids.split(","); |
|
|
|
List<WarehouseInventoryReportDamageChild> list = damageChildMapper.selectWarehouseInventoryReportDamageChildByCodes(damageCodes); |
|
|
|
ExcelUtil<WarehouseInventoryReportDamageChild> util = new ExcelUtil<WarehouseInventoryReportDamageChild>(WarehouseInventoryReportDamageChild.class); |
|
|
|
return util.exportExcel(list, ids); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -122,7 +141,7 @@ public class WarehouseInventoryReportDamageController extends BaseController |
|
|
|
@Log(title = "仓库库存报损", businessType = BusinessType.UPDATE) |
|
|
|
@PostMapping("/edit") |
|
|
|
@ResponseBody |
|
|
|
public AjaxResult editSave(WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|
|
|
public AjaxResult editSave(@RequestBody WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|
|
|
{ |
|
|
|
return toAjax(warehouseInventoryReportDamageService.updateWarehouseInventoryReportDamage(warehouseInventoryReportDamage)); |
|
|
|
} |
|
|
|