修改和报错问题

This commit is contained in:
Chujinwang 2024-07-22 09:26:37 +08:00
parent e41669ed0a
commit e966326dbc
8 changed files with 24 additions and 10 deletions

View File

@ -128,4 +128,6 @@ public class TerminalQuery extends CommonParam {
private Long terminalId; private Long terminalId;
private Long storeId;
} }

View File

@ -97,11 +97,7 @@ public class WrkInfo extends BaseEntity {
*/ */
@TableField(value = "work_source") @TableField(value = "work_source")
private Integer workSource; private Integer workSource;
/**
* 第三方 工单编号
*/
@TableField(value = "order_no")
private String orderNo;
/** /**
* 业务员处理时间 * 业务员处理时间

View File

@ -81,8 +81,7 @@ public class TerminalController {
@PostMapping("/update") @PostMapping("/update")
@RequiresPermissions("ins:terminal:update") @RequiresPermissions("ins:terminal:update")
public AjaxResult update(@RequestBody @Validated TerminalQuery query) { public AjaxResult update(@RequestBody @Validated TerminalQuery query) {
Terminal terminal = BeanUtil.copyProperties(query, Terminal.class); return AjaxResult.success(terminalService.updateTerminalAndStore(query));
return AjaxResult.success(terminalService.updateById(terminal));
} }
@DeleteMapping(value = "/del/{terminalId}") @DeleteMapping(value = "/del/{terminalId}")

View File

@ -56,5 +56,10 @@ public interface TerminalService extends IService<Terminal>{
JSONObject save(Store store, WrkIcbcJsReceive dto); JSONObject save(Store store, WrkIcbcJsReceive dto);
int updateTerminalAndStore(TerminalQuery query);
JSONObject getTerMap(Long terminalId); JSONObject getTerMap(Long terminalId);
} }

View File

@ -26,6 +26,7 @@ import com.chushang.inspection.terminal.service.TerminalInsService;
import com.chushang.inspection.terminal.service.TerminalService; import com.chushang.inspection.terminal.service.TerminalService;
import com.chushang.inspection.terminal.vo.StoreTerminalVO; import com.chushang.inspection.terminal.vo.StoreTerminalVO;
import com.chushang.inspection.terminal.vo.TerminalVO; import com.chushang.inspection.terminal.vo.TerminalVO;
import com.chushang.inspection.utils.BeanCopyUtils;
import com.chushang.inspection.utils.TaskConfigUtils; import com.chushang.inspection.utils.TaskConfigUtils;
import com.chushang.inspection.work.dto.DispatchDTO; import com.chushang.inspection.work.dto.DispatchDTO;
import com.chushang.inspection.work.dto.WrkIcbcJsReceive; import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
@ -35,6 +36,7 @@ import com.chushang.system.feign.RemoteDeptService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chushang.inspection.terminal.mapper.TerminalMapper; import com.chushang.inspection.terminal.mapper.TerminalMapper;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -146,4 +148,14 @@ public class TerminalServiceImpl extends ServiceImpl<TerminalMapper, Terminal> i
return JSONObject.of("terminal", getById(terminalId), "terminalIns", terminalInsService.getById(terminalId)); return JSONObject.of("terminal", getById(terminalId), "terminalIns", terminalInsService.getById(terminalId));
} }
@Override
@Transactional(rollbackFor = Exception.class)
public int updateTerminalAndStore(TerminalQuery query) {
Terminal terminal = BeanCopyUtils.copy(query, Terminal.class);
updateById(terminal);
Store store = BeanCopyUtils.copy(query, Store.class);
storeService.updateById(store);
return 1;
}
} }

View File

@ -254,7 +254,7 @@ public class WrkInfoController {
@PostMapping("/withdraw") @PostMapping("/withdraw")
@RequiresPermissions("wrk:withdraw") @RequiresPermissions("wrk:withdraw")
@SysLog(value = "工单撤回", businessType = BusinessType.DELETE) @SysLog(value = "工单撤回", businessType = BusinessType.DELETE)
public AjaxResult withdraw(@RequestBody @Validated Delete delete) { public AjaxResult withdraw(@RequestBody @Validated Delete delete) throws Exception{
wrkInfoService.withdraw(delete.getIds()); wrkInfoService.withdraw(delete.getIds());
return AjaxResult.success(); return AjaxResult.success();
} }

View File

@ -38,7 +38,7 @@ public interface WrkInfoService extends IService<WrkInfo> {
void submit(WrkInfoDTO info); void submit(WrkInfoDTO info);
void withdraw(List<Long> ids); void withdraw(List<Long> ids) throws Exception;
void audit(AuditDTO audit); void audit(AuditDTO audit);

View File

@ -357,7 +357,7 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void withdraw(List<Long> ids) { public void withdraw(List<Long> ids) throws Exception{
List<Integer> status = ListUtil.toList(1, 2, 5, 6, 7); List<Integer> status = ListUtil.toList(1, 2, 5, 6, 7);
LambdaQueryWrapper<WrkInfo> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<WrkInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(WrkInfo::getWrkId, ids); queryWrapper.in(WrkInfo::getWrkId, ids);