|
|
@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.AjaxResult; |
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser; |
|
|
|
import com.ruoyi.common.core.page.TableDataInfo; |
|
|
|
import com.ruoyi.common.enums.BusinessType; |
|
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil; |
|
|
|
import com.ruoyi.erp.domain.ErpMaterial; |
|
|
@ -16,11 +17,10 @@ import com.ruoyi.erp.mapper.ErpMaterialMapper; |
|
|
|
import com.ruoyi.erp.service.IErpMaterialService; |
|
|
|
import com.ruoyi.process.general.service.IProcessService; |
|
|
|
import com.ruoyi.system.domain.SysCustomer; |
|
|
|
import com.ruoyi.system.domain.SysCustomerOper; |
|
|
|
import com.ruoyi.system.domain.SysErpMaterialSysTechnicalTeam; |
|
|
|
import com.ruoyi.system.service.ISysErpMaterialSysTechnicalTeamService; |
|
|
|
import com.ruoyi.system.service.ISysTechnicalTeamService; |
|
|
|
import com.ruoyi.system.service.ISysRoleService; |
|
|
|
import com.ruoyi.system.service.ISysUserService; |
|
|
|
import com.ruoyi.system.domain.SysPost; |
|
|
|
import com.ruoyi.system.service.*; |
|
|
|
import com.ruoyi.warehouse.controller.WarehouseInventoryInquiryController; |
|
|
|
import com.ruoyi.warehouse.service.IWarehouseInventoryInquiryService; |
|
|
|
import org.activiti.engine.RuntimeService; |
|
|
@ -79,6 +79,12 @@ public class ErpMaterialController extends BaseController |
|
|
|
@Autowired |
|
|
|
private IWarehouseInventoryInquiryService warehouseInventoryInquiryService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ISysPostService sysPostService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ISysCustomerOperService sysCustomerOperService; |
|
|
|
|
|
|
|
@RequiresPermissions("erp:material:view") |
|
|
|
@GetMapping() |
|
|
|
public String material(ModelMap mmap) |
|
|
@ -158,10 +164,21 @@ public class ErpMaterialController extends BaseController |
|
|
|
@ResponseBody |
|
|
|
public AjaxResult addSave(ErpMaterial erpMaterial) |
|
|
|
{ |
|
|
|
SysUser sysUser = ShiroUtils.getSysUser(); |
|
|
|
List<SysPost> sysPostsList = sysPostService.selectPostsByUserId(sysUser.getUserId()); |
|
|
|
String operPeople = sysUser.getDept().getDeptName() + "/" + sysPostsList.get(0).getPostName()+"/" + sysUser.getUserName(); |
|
|
|
// 使用状态-否
|
|
|
|
erpMaterial.setUseStatus("0"); |
|
|
|
// 审核状态-待审核
|
|
|
|
erpMaterial.setAuditStatus("0"); |
|
|
|
|
|
|
|
SysCustomerOper sysCustomerOper = new SysCustomerOper(); |
|
|
|
sysCustomerOper.setPurser(erpMaterial.getBusinessMembers()); |
|
|
|
sysCustomerOper.setEnterpriseCode(erpMaterial.getMaterialNo()); |
|
|
|
sysCustomerOper.setOper("新建"); |
|
|
|
sysCustomerOper.setOperPeople(operPeople); |
|
|
|
sysCustomerOper.setCreateTime(DateUtils.getNowDate()); |
|
|
|
sysCustomerOperService.insertSysCustomerOper(sysCustomerOper); |
|
|
|
erpMaterialService.submitApply(erpMaterial); |
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
@ -228,6 +245,18 @@ public class ErpMaterialController extends BaseController |
|
|
|
} |
|
|
|
} |
|
|
|
erpMaterialService.updateErpMaterial(erpMaterialVo); |
|
|
|
SysUser sysUser = ShiroUtils.getSysUser(); |
|
|
|
List<SysPost> sysPostsList = sysPostService.selectPostsByUserId(sysUser.getUserId()); |
|
|
|
String operPeople = sysUser.getDept().getDeptName() + "/" + sysPostsList.get(0).getPostName()+"/" + sysUser.getUserName(); |
|
|
|
|
|
|
|
SysCustomerOper sysCustomerOper = new SysCustomerOper(); |
|
|
|
sysCustomerOper.setPurser(erpMaterialVo.getBusinessMembers()); |
|
|
|
sysCustomerOper.setEnterpriseCode(erpMaterialVo.getMaterialNo()); |
|
|
|
sysCustomerOper.setOper("审核"); |
|
|
|
sysCustomerOper.setOperPeople(operPeople); |
|
|
|
sysCustomerOper.setCreateTime(DateUtils.getNowDate()); |
|
|
|
|
|
|
|
sysCustomerOperService.insertSysCustomerOper(sysCustomerOper); |
|
|
|
// 驳回申请后继续申请,可能修改表单
|
|
|
|
if (saveEntityBoolean) { |
|
|
|
erpMaterialVo.setAuditStatus("0"); |
|
|
@ -249,7 +278,7 @@ public class ErpMaterialController extends BaseController |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改物料信息 |
|
|
|
* 打开物料修改页面 |
|
|
|
*/ |
|
|
|
@GetMapping("/edit/{id}") |
|
|
|
public String edit(@PathVariable("id") Long id, ModelMap mmap) |
|
|
@ -274,10 +303,21 @@ public class ErpMaterialController extends BaseController |
|
|
|
@ResponseBody |
|
|
|
public AjaxResult editSave(ErpMaterial erpMaterial) |
|
|
|
{ |
|
|
|
SysUser sysUser = ShiroUtils.getSysUser(); |
|
|
|
List<SysPost> sysPostsList = sysPostService.selectPostsByUserId(sysUser.getUserId()); |
|
|
|
String operPeople = sysUser.getDept().getDeptName() + "/" + sysPostsList.get(0).getPostName()+"/" + sysUser.getUserName(); |
|
|
|
// 使用状态-否
|
|
|
|
erpMaterial.setUseStatus("0"); |
|
|
|
// 审核状态-待审核
|
|
|
|
erpMaterial.setAuditStatus("0"); |
|
|
|
ErpMaterialVo erpMaterialVo = erpMaterialService.selectErpMaterialById(erpMaterial.getId()); |
|
|
|
SysCustomerOper sysCustomerOper = new SysCustomerOper(); |
|
|
|
sysCustomerOper.setPurser(erpMaterial.getBusinessMembers()); |
|
|
|
sysCustomerOper.setEnterpriseCode(erpMaterialVo.getMaterialNo()); |
|
|
|
sysCustomerOper.setOper("修改"); |
|
|
|
sysCustomerOper.setOperPeople(operPeople); |
|
|
|
sysCustomerOper.setCreateTime(DateUtils.getNowDate()); |
|
|
|
sysCustomerOperService.insertSysCustomerOper(sysCustomerOper); |
|
|
|
erpMaterialService.submitApply(erpMaterial); |
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
|