Browse Source

[fix] 销售管理

修改旧版物料详情的前端操作历史列表,按照prd调整
修改物料新增后端接口.物料新增的同时,新增操作历史数据,关联用户表和岗位表
修改物料修改后端接口.物料修改的同时,新增操作历史数据,关联用户表和岗位表
修改物料审核后端接口.物料审核的同时,新增操作历史数据,关联用户表和岗位表
修改物料作废后端接口.物料作废的同时,新增操作历史数据,关联用户表和岗位表
修改物料恢复后端接口.物料恢复的同时,新增操作历史数据,关联用户表和岗位表
dev
liuxiaoxu 2 weeks ago
parent
commit
fde318f67a
  1. 50
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  2. 32
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  3. 25
      ruoyi-admin/src/main/resources/templates/erp/material/detail.html

50
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -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();
}

32
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -27,9 +27,7 @@ import com.ruoyi.system.domain.Vo.ExportCustomerQuoteChildVo;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysAttachFileService;
import com.ruoyi.system.service.ISysAttachService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.*;
import com.ruoyi.warehouse.domain.WarehouseInventoryInquiry;
import com.ruoyi.warehouse.mapper.WarehouseInventoryInquiryMapper;
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderDetailMapper;
@ -97,7 +95,11 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
@Autowired
private PurchaseOrderChildMapper purchaseOrderChildMapper;
@Autowired
private ISysPostService sysPostService;
@Autowired
private ISysCustomerOperService sysCustomerOperService;
private final static String RMB = "1"; //RMB
@ -416,6 +418,18 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
public int cancelErpMaterialByObject(ErpMaterial erpMaterial) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(erpMaterial.getId());
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(erpMaterial.getBusinessMembers());
sysCustomerOper.setEnterpriseCode(erpMaterialVo.getMaterialNo());
sysCustomerOper.setOper("作废");
sysCustomerOper.setOperPeople(operPeople);
sysCustomerOper.setCreateTime(DateUtils.getNowDate());
sysCustomerOperService.insertSysCustomerOper(sysCustomerOper);
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
@ -443,6 +457,18 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
@Override
public ProcessInstance restoreErpMaterialById(Long id) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id);
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);
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();

25
ruoyi-admin/src/main/resources/templates/erp/material/detail.html

@ -572,12 +572,8 @@
visible: false
},
{
field: 'enterpriseName',
title: '物料名称',
},
{
field: 'purser',
title: '事业部'
field: 'createTime',
title: '操作时间',
},
{
field: 'operPeople',
@ -585,23 +581,8 @@
},
{
field: 'oper',
field: '操作'
title: '操作'
},
{
field: 'createTime',
field: '操作时间',
},{
field: 'operStatus',
title: '操作状态',
formatter: function (value,index,row){
if (value == 0){
return '成功';
}else{
return '失败';
}
}
}
]
};
$.table.init(option4);

Loading…
Cancel
Save