| | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import zy.cloud.wms.manager.dto.DiffValDto; |
| | | import zy.cloud.wms.manager.entity.DiffVal; |
| | | import zy.cloud.wms.manager.entity.Mat; |
| | | import zy.cloud.wms.manager.mapper.MatMapper; |
| | | import zy.cloud.wms.manager.service.DiffValService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | |
| | | |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | public class DiffValController extends BaseController { |
| | | |
| | | @Autowired |
| | | private DiffValService diffValService; |
| | | @Autowired |
| | | private MatMapper matMapper; |
| | | |
| | | @RequestMapping(value = "/diffVal/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | @RequestParam Map<String, Object> param, |
| | | @RequestParam(defaultValue = "0", required = false)Integer includeZero){ |
| | | EntityWrapper<DiffVal> wrapper = new EntityWrapper<>(); |
| | | param.remove("includeZero"); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(diffValService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | //朱航帅 |
| | | log.info("includeZero的值是"+includeZero); |
| | | if (includeZero != 0){ |
| | | wrapper.ne("val",0.0); |
| | | } |
| | | Page<DiffVal> diffValPage = diffValService.selectPage(new Page<>(curr, limit), wrapper); |
| | | for (DiffVal record : diffValPage.getRecords()) { |
| | | Mat mat = matMapper.selectByMatnr(record.getMatnr()); |
| | | record.setMaktx(mat==null?record.getMatnr():mat.getMaktx()); |
| | | } |
| | | |
| | | return R.ok(diffValPage); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping("/diffVal/getList") |
| | | @ManagerAuth |
| | | public R getList(@RequestParam(required = false) String condition, |
| | | @RequestParam Integer type) { |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | HashMap<String, Object> trueResult = new HashMap<>(); |
| | | trueResult.put("val","0"); |
| | | HashMap<String, Object> falseResult = new HashMap<>(); |
| | | falseResult.put("val","1"); |
| | | result.add(trueResult); |
| | | result.add(falseResult); |
| | | return R.ok().add(result); |
| | | } |
| | | } |