新购附件优化
This commit is contained in:
parent
fbad0e8178
commit
0d3fe514b8
|
|
@ -84,9 +84,9 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
@RequiresPermissions("purchase:info:edit")
|
@RequiresPermissions("purchase:info:edit")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->修改新购验收任务")
|
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "物资新购->修改新购验收任务")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody PurchaseCheckInfo purchaseCheckInfo) {
|
public AjaxResult edit(@RequestBody PurchaseCheckDto purchaseCheckDto) {
|
||||||
try {
|
try {
|
||||||
return toAjax(purchaseCheckInfoService.updatePurchaseCheckInfo(purchaseCheckInfo));
|
return toAjax(purchaseCheckInfoService.updatePurchaseCheckInfo(purchaseCheckDto));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
return error("系统错误, " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class PurchaseNoticePersonController extends BaseController {
|
||||||
* 查询新购短信通知人员列表
|
* 查询新购短信通知人员列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询新购短信通知人员列表")
|
@ApiOperation(value = "查询新购短信通知人员列表")
|
||||||
@RequiresPermissions("purchase:person:list")
|
@RequiresPermissions("purchase:person:notice")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(PurchaseNoticePerson purchaseNoticePerson) {
|
public TableDataInfo list(PurchaseNoticePerson purchaseNoticePerson) {
|
||||||
List<PurchaseNoticePerson> list = purchaseNoticePersonService.selectPurchaseNoticePersonList(purchaseNoticePerson);
|
List<PurchaseNoticePerson> list = purchaseNoticePersonService.selectPurchaseNoticePersonList(purchaseNoticePerson);
|
||||||
|
|
@ -56,7 +56,7 @@ public class PurchaseNoticePersonController extends BaseController {
|
||||||
* 查询新购短信通知人员列表
|
* 查询新购短信通知人员列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询等待选择的新购短信通知人员列表")
|
@ApiOperation(value = "查询等待选择的新购短信通知人员列表")
|
||||||
@RequiresPermissions("purchase:person:list")
|
@RequiresPermissions("purchase:person:notice")
|
||||||
@GetMapping("/listUnSelected")
|
@GetMapping("/listUnSelected")
|
||||||
public TableDataInfo listUnSelected() {
|
public TableDataInfo listUnSelected() {
|
||||||
List<PurchaseNoticePerson> list = purchaseNoticePersonService.getUnSelectedUserList();
|
List<PurchaseNoticePerson> list = purchaseNoticePersonService.getUnSelectedUserList();
|
||||||
|
|
@ -68,7 +68,7 @@ public class PurchaseNoticePersonController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "导出新购短信通知人员列表")
|
@ApiOperation(value = "导出新购短信通知人员列表")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("purchase:person:export")
|
@RequiresPermissions("purchase:person:notice")
|
||||||
@SysLog(title = "新购短信通知人员", businessType = OperaType.EXPORT, module = "物资新购->导出新购短信通知人员")
|
@SysLog(title = "新购短信通知人员", businessType = OperaType.EXPORT, module = "物资新购->导出新购短信通知人员")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, PurchaseNoticePerson purchaseNoticePerson) {
|
public void export(HttpServletResponse response, PurchaseNoticePerson purchaseNoticePerson) {
|
||||||
|
|
@ -81,7 +81,7 @@ public class PurchaseNoticePersonController extends BaseController {
|
||||||
* 获取新购短信通知人员详细信息
|
* 获取新购短信通知人员详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取新购短信通知人员详细信息")
|
@ApiOperation(value = "获取新购短信通知人员详细信息")
|
||||||
@RequiresPermissions("purchase:person:query")
|
@RequiresPermissions("purchase:person:notice")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
return success(purchaseNoticePersonService.selectPurchaseNoticePersonById(id));
|
return success(purchaseNoticePersonService.selectPurchaseNoticePersonById(id));
|
||||||
|
|
@ -92,7 +92,7 @@ public class PurchaseNoticePersonController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "新增新购短信通知人员")
|
@ApiOperation(value = "新增新购短信通知人员")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("purchase:person:add")
|
@RequiresPermissions("purchase:person:notice")
|
||||||
@SysLog(title = "新购短信通知人员", businessType = OperaType.INSERT, module = "物资新购->新增新购短信通知人员")
|
@SysLog(title = "新购短信通知人员", businessType = OperaType.INSERT, module = "物资新购->新增新购短信通知人员")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody PurchaseNoticePerson purchaseNoticePerson) {
|
public AjaxResult add(@RequestBody PurchaseNoticePerson purchaseNoticePerson) {
|
||||||
|
|
@ -108,7 +108,7 @@ public class PurchaseNoticePersonController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "批量新增新购短信通知人员")
|
@ApiOperation(value = "批量新增新购短信通知人员")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("purchase:person:add")
|
@RequiresPermissions("purchase:person:notice")
|
||||||
@SysLog(title = "批量新增新购短信通知人员", businessType = OperaType.INSERT, module = "物资新购->批量新增新购短信通知人员")
|
@SysLog(title = "批量新增新购短信通知人员", businessType = OperaType.INSERT, module = "物资新购->批量新增新购短信通知人员")
|
||||||
@PostMapping("/batchAddNoticePerson")
|
@PostMapping("/batchAddNoticePerson")
|
||||||
public AjaxResult batchAddNoticePerson(@RequestBody List<PurchaseNoticePerson> purchaseNoticePersonList) {
|
public AjaxResult batchAddNoticePerson(@RequestBody List<PurchaseNoticePerson> purchaseNoticePersonList) {
|
||||||
|
|
@ -124,7 +124,7 @@ public class PurchaseNoticePersonController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "批量发送短信")
|
@ApiOperation(value = "批量发送短信")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("purchase:person:edit")
|
@RequiresPermissions("purchase:person:notice")
|
||||||
@SysLog(title = "批量发送短信", businessType = OperaType.UPDATE, module = "物资新购->批量发送短信")
|
@SysLog(title = "批量发送短信", businessType = OperaType.UPDATE, module = "物资新购->批量发送短信")
|
||||||
@PutMapping("/batchSendSms")
|
@PutMapping("/batchSendSms")
|
||||||
public AjaxResult batchSendSms(@NotNull @Valid @RequestBody PurchaseNoticePersonDto purchaseNoticePersonDto) {
|
public AjaxResult batchSendSms(@NotNull @Valid @RequestBody PurchaseNoticePersonDto purchaseNoticePersonDto) {
|
||||||
|
|
@ -136,7 +136,7 @@ public class PurchaseNoticePersonController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "修改新购短信通知人员")
|
@ApiOperation(value = "修改新购短信通知人员")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("purchase:person:edit")
|
@RequiresPermissions("purchase:person:notice")
|
||||||
@SysLog(title = "新购短信通知人员", businessType = OperaType.UPDATE, module = "物资新购->修改新购短信通知人员")
|
@SysLog(title = "新购短信通知人员", businessType = OperaType.UPDATE, module = "物资新购->修改新购短信通知人员")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody PurchaseNoticePerson purchaseNoticePerson) {
|
public AjaxResult edit(@RequestBody PurchaseNoticePerson purchaseNoticePerson) {
|
||||||
|
|
@ -152,7 +152,7 @@ public class PurchaseNoticePersonController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除新购短信通知人员")
|
@ApiOperation(value = "删除新购短信通知人员")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("purchase:person:remove")
|
@RequiresPermissions("purchase:person:notice")
|
||||||
@SysLog(title = "新购短信通知人员", businessType = OperaType.DELETE, module = "物资新购->删除新购短信通知人员")
|
@SysLog(title = "新购短信通知人员", businessType = OperaType.DELETE, module = "物资新购->删除新购短信通知人员")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,10 @@ public interface IPurchaseCheckInfoService {
|
||||||
/**
|
/**
|
||||||
* 修改新购验收任务
|
* 修改新购验收任务
|
||||||
*
|
*
|
||||||
* @param purchaseCheckInfo 新购验收任务
|
* @param purchaseCheckDto 新购验收任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
|
boolean updatePurchaseCheckInfo(PurchaseCheckDto purchaseCheckDto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除新购验收任务
|
* 批量删除新购验收任务
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import java.util.stream.Collectors;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.basic.domain.BmFileInfo;
|
import com.bonus.material.basic.domain.BmFileInfo;
|
||||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
import com.bonus.material.purchase.config.PurchaseTaskEnum;
|
import com.bonus.material.purchase.config.PurchaseTaskEnum;
|
||||||
|
|
@ -31,6 +32,7 @@ import com.bonus.material.purchase.service.IPurchaseCheckInfoService;
|
||||||
import org.springframework.transaction.PlatformTransactionManager;
|
import org.springframework.transaction.PlatformTransactionManager;
|
||||||
import org.springframework.transaction.TransactionStatus;
|
import org.springframework.transaction.TransactionStatus;
|
||||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
@ -165,6 +167,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
public AjaxResult insertPurchaseCheckInfo(PurchaseCheckDto purchaseCheckInfo) {
|
public AjaxResult insertPurchaseCheckInfo(PurchaseCheckDto purchaseCheckInfo) {
|
||||||
// 赋值创建时间
|
// 赋值创建时间
|
||||||
purchaseCheckInfo.getPurchaseCheckInfo().setCreateTime(DateUtils.getNowDate());
|
purchaseCheckInfo.getPurchaseCheckInfo().setCreateTime(DateUtils.getNowDate());
|
||||||
|
purchaseCheckInfo.getPurchaseCheckInfo().setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||||
try {
|
try {
|
||||||
// 查询新购任务当月最大单号
|
// 查询新购任务当月最大单号
|
||||||
Integer thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), Long.valueOf(PurchaseTaskEnum.PURCHASE_TASK_STATUS_WAIT_NOTICE.getTaskTypeId()));
|
Integer thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), Long.valueOf(PurchaseTaskEnum.PURCHASE_TASK_STATUS_WAIT_NOTICE.getTaskTypeId()));
|
||||||
|
|
@ -198,9 +201,11 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
List<PurchaseCheckDetails> purchaseCheckDetailsList = purchaseCheckInfo.getPurchaseCheckDetailsList();
|
List<PurchaseCheckDetails> purchaseCheckDetailsList = purchaseCheckInfo.getPurchaseCheckDetailsList();
|
||||||
for (PurchaseCheckDetails purchaseCheckDetails : purchaseCheckDetailsList) {
|
for (PurchaseCheckDetails purchaseCheckDetails : purchaseCheckDetailsList) {
|
||||||
List<BmFileInfo> bmFileInfos = purchaseCheckDetails.getBmFileInfos();
|
List<BmFileInfo> bmFileInfos = purchaseCheckDetails.getBmFileInfos();
|
||||||
|
if (!CollectionUtils.isEmpty(bmFileInfos)) {
|
||||||
bmFileInfos.stream().forEach(o -> o.setTaskId(taskId));
|
bmFileInfos.stream().forEach(o -> o.setTaskId(taskId));
|
||||||
bmFileInfoMapper.insertBmFileInfos(bmFileInfos);
|
bmFileInfoMapper.insertBmFileInfos(bmFileInfos);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (purchaseCheckDetailsListAddResult) {
|
if (purchaseCheckDetailsListAddResult) {
|
||||||
transactionManager.commit(transactionStatus);
|
transactionManager.commit(transactionStatus);
|
||||||
|
|
@ -297,14 +302,20 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
/**
|
/**
|
||||||
* 修改新购验收任务
|
* 修改新购验收任务
|
||||||
*
|
*
|
||||||
* @param purchaseCheckInfo 新购验收任务
|
* @param purchaseCheckDto 新购验收任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo) {
|
public boolean updatePurchaseCheckInfo(PurchaseCheckDto purchaseCheckDto) {
|
||||||
purchaseCheckInfo.setUpdateTime(DateUtils.getNowDate());
|
purchaseCheckDto.getPurchaseCheckInfo().setUpdateTime(DateUtils.getNowDate());
|
||||||
|
purchaseCheckDto.getPurchaseCheckInfo().setUpdateBy(SecurityUtils.getUsername());
|
||||||
try {
|
try {
|
||||||
return purchaseCheckInfoMapper.updatePurchaseCheckInfo(purchaseCheckInfo);
|
List<PurchaseCheckDetails> purchaseCheckDetailsList = purchaseCheckDto.getPurchaseCheckDetailsList();
|
||||||
|
for (PurchaseCheckDetails purchaseCheckDetails : purchaseCheckDetailsList) {
|
||||||
|
purchaseCheckDetailsMapper.updatePurchaseCheckDetails(purchaseCheckDetails);
|
||||||
|
}
|
||||||
|
purchaseCheckInfoMapper.updatePurchaseCheckInfo(purchaseCheckDto.getPurchaseCheckInfo());
|
||||||
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("错误信息描述");
|
throw new ServiceException("错误信息描述");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue