新购验收模块调整
This commit is contained in:
parent
62246c0c93
commit
450725293a
|
|
@ -19,8 +19,7 @@ import com.bonus.system.api.model.LoginUser;
|
|||
* @author bonus
|
||||
*/
|
||||
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
|
||||
public interface RemoteUserService
|
||||
{
|
||||
public interface RemoteUserService {
|
||||
/**
|
||||
* 通过用户名查询用户信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -82,4 +82,17 @@ public final class ResultBean<T> implements java.io.Serializable{
|
|||
return new ResultBean<>(record > 0 ? HttpStatus.SUCCESS : HttpStatus.NO_CONTENT, "error", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除/修改/新增操作 根据影响条数返回响应内容
|
||||
*
|
||||
* @return 构建的ResultBean实例
|
||||
*/
|
||||
public static <T> ResultBean<T> toIsSuccess(int record) {
|
||||
if (record > 0) {
|
||||
return new ResultBean<>(HttpStatus.SUCCESS, "success", null);
|
||||
} else {
|
||||
return new ResultBean<>(HttpStatus.NOT_MODIFIED, "error", null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ package com.bonus.common.core.utils;
|
|||
*/
|
||||
public class NumberUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 将对象转换为int
|
||||
* @param obj 对象
|
||||
|
|
@ -43,18 +42,15 @@ public class NumberUtils {
|
|||
* @return 运算结果
|
||||
*/
|
||||
public static int operate(int amount1, int amount2, char operation, int scale) {
|
||||
int result;
|
||||
|
||||
if (scale != 100 && scale != 1000) {
|
||||
throw new IllegalArgumentException("此方法只适用于100倍,1000倍的计算方法");
|
||||
}
|
||||
|
||||
if (operation == '*') {
|
||||
result = (amount1 / scale) * (amount2 / scale) * scale;
|
||||
return (amount1 / scale) * (amount2 / scale) * scale;
|
||||
} else {
|
||||
throw new IllegalArgumentException("请输入正确的(*)运算符: " + operation);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ public class BmProjectController extends BaseController {
|
|||
@ApiOperation(value = "获取工程下拉选")
|
||||
@GetMapping("/getProjectSelect")
|
||||
public AjaxResult getUnitInfoSelect(BmProject bmProject) {
|
||||
List<BmProject> list = bmProjectService.selectAll(bmProject);
|
||||
return AjaxResult.success(list);
|
||||
return AjaxResult.success(bmProjectService.selectAll(bmProject));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -104,12 +103,11 @@ public class BmProjectController extends BaseController {
|
|||
*/
|
||||
@PutMapping(value = "/update")
|
||||
@RequiresPermissions("base:project:edit")
|
||||
public ResultBean<Boolean> edit(@NotNull @Valid @RequestBody BmProject obj) {
|
||||
public ResultBean<Object> edit(@NotNull @Valid @RequestBody BmProject obj) {
|
||||
if (this.bmProjectService.selectByName(obj.getName()) > 1) {
|
||||
return ResultBean.error("工程名称重复");
|
||||
}
|
||||
this.bmProjectService.updateByPrimaryKeySelective(obj);
|
||||
return ResultBean.success(true);
|
||||
return ResultBean.toIsSuccess(this.bmProjectService.updateByPrimaryKeySelective(obj));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -124,7 +122,7 @@ public class BmProjectController extends BaseController {
|
|||
public ResultBean<String> deleteById(@PathVariable("id")
|
||||
@NotNull(message = "ID不能为空")
|
||||
@Positive(message = "ID必须为正整数") Integer id) {
|
||||
return ResultBean.toIsSuccess(this.bmProjectService.updateIsActive(id),"删除失败");
|
||||
return ResultBean.toIsSuccess(this.bmProjectService.updateIsActive(id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -49,6 +49,16 @@ public class MaHouseController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 全部查询
|
||||
*/
|
||||
@ApiOperation(value = "全部查询")
|
||||
@GetMapping("/all")
|
||||
@RequiresPermissions("material:maHouse:query")
|
||||
public AjaxResult queryAll() {
|
||||
return success(maHouseService.queryByPage(new MaHouse()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.bonus.purchase.service.impl.BpmPurchaseInfoService;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +33,7 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
@GetMapping(value = "/list")
|
||||
public TableDataInfo getList(BpmPurchaseInfo bpmPurchaseInfo) {
|
||||
startPage();
|
||||
List<BpmPurchaseInfo> list = this.bpmPurchaseInfoService.selectAll();
|
||||
List<BpmPurchaseInfo> list = this.bpmPurchaseInfoService.selectAll(bpmPurchaseInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +45,7 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResultBean<BpmPurchaseInfo> queryById(@PathVariable("id") Integer id) {
|
||||
public ResultBean<BpmPurchaseInfo> queryById(@NotNull(message = "ID不能为空") @PathVariable("id") Integer id) {
|
||||
return ResultBean.success(this.bpmPurchaseInfoService.selectByPrimaryKey(id));
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +56,7 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public ResultBean< Boolean> add(@RequestBody BpmPurchaseInfo bpmPurchaseInfo) {
|
||||
public ResultBean< Boolean> add(@NotNull @Valid @RequestBody BpmPurchaseInfo bpmPurchaseInfo) {
|
||||
this.bpmPurchaseInfoService.insertSelective(bpmPurchaseInfo);
|
||||
return ResultBean.success(true);
|
||||
}
|
||||
|
|
@ -66,7 +68,7 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping(value = "/update")
|
||||
public ResultBean< Boolean> edit(@RequestBody BpmPurchaseInfo bpmPurchaseInfo) {
|
||||
public ResultBean< Boolean> edit(@NotNull @RequestBody BpmPurchaseInfo bpmPurchaseInfo) {
|
||||
this.bpmPurchaseInfoService.updateByPrimaryKeySelective(bpmPurchaseInfo);
|
||||
return ResultBean.success(true);
|
||||
}
|
||||
|
|
@ -77,7 +79,7 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@PostMapping(value = "/delete/{id}")
|
||||
@DeleteMapping(value = "/delete/{id}")
|
||||
public ResultBean< Boolean> deleteById(@PathVariable("id") Integer id) {
|
||||
this.bpmPurchaseInfoService.deleteByPrimaryKey(id);
|
||||
return ResultBean.success(true);
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
@Mapper
|
||||
public interface BpmPurchaseInfoMapper {
|
||||
|
||||
List<BpmPurchaseInfo> selectAll();
|
||||
|
||||
List<BpmPurchaseInfo> selectAll(BpmPurchaseInfo bpmPurchaseInfo);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
||||
import com.bonus.purchase.domain.BpmPurchaseInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
*@PackagePath: com.bonus.purchase
|
||||
*@author : 阮世耀
|
||||
|
|
@ -18,7 +20,7 @@ import com.bonus.purchase.domain.BpmPurchaseInfo;
|
|||
@Service
|
||||
public class BpmPurchaseInfoService{
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private BpmPurchaseInfoMapper bpmPurchaseInfoMapper;
|
||||
|
||||
|
||||
|
|
@ -61,8 +63,8 @@ public class BpmPurchaseInfoService{
|
|||
return bpmPurchaseInfoMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
public List<BpmPurchaseInfo> selectAll(){
|
||||
return bpmPurchaseInfoMapper.selectAll();
|
||||
public List<BpmPurchaseInfo> selectAll(BpmPurchaseInfo bpmPurchaseInfo){
|
||||
return bpmPurchaseInfoMapper.selectAll(bpmPurchaseInfo);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -541,7 +541,6 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<!--by syruan on 2024-08-19-->
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
Loading…
Reference in New Issue