| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.param.ProductCalibrationExcelParam; |
| | | import com.zy.asrs.importexcle.LocMat; |
| | |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import lombok.Synchronized; |
| | | import org.apache.ibatis.session.SqlSessionFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(LocDetl.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | // if (!row.equals("")){ |
| | | // wrapper.and() |
| | | // .where("loc_no like '" +row +"%'"); |
| | |
| | | @Autowired |
| | | private LocDetlMapper LocDetlMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | @RequestMapping(value = "/locDetl/statis/export") |
| | | // @ManagerAuth |
| | | public void statisExport(HttpServletResponse response) throws IOException { |
| | |
| | | |
| | | /** |
| | | * 获取库存总数 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/locDetl/count") |
| | |
| | | return R.ok(sum); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/locDetl/sync/auth") |
| | | @ManagerAuth |
| | | @Synchronized |
| | | public R sync() { |
| | | EntityWrapper<LocMast> locMastEntityWrapper = new EntityWrapper<>(); |
| | | int i = locMastService.selectCount(locMastEntityWrapper.in("loc_sts", "S", "R", "P", "Q")); |
| | | if (i > 0) { |
| | | return R.error("有" + i + "条数据处于出入库预约或盘点拣料中,无法同步库存"); |
| | | } |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code","sync")); |
| | | if (config==null){ |
| | | config=new Config(); |
| | | config.setValue("1"); |
| | | config.setStatus((short) 1); |
| | | config.setCode("sync"); |
| | | config.setType((short) 1); |
| | | config.setName("同步期初数据MES"); |
| | | }else { |
| | | if (config.getValue().equals("1")){ |
| | | return R.error("数据同步中,请勿重复点击"); |
| | | } |
| | | config.setValue("1"); |
| | | configService.updateById(config); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |