| | |
| | | <artifactId>standard-server</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.yuanchu.mom</groupId> |
| | | <artifactId>inventory-server</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.vaadin.external.google</groupId> |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @Autowired |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->1ãæ°å¢æåæ£éªå") |
| | | @PostMapping("/add_process_inspection_sheet") |
| | |
| | | @ApiImplicitParam(name = "result",value = "æ£éªç»è®º",dataTypeClass = Integer.class,required = true), |
| | | }) |
| | | @PostMapping("/inspection_conclusion") |
| | | public Result<?> inspectionConclusion(Integer finishedInspectId, Integer result){ |
| | | Integer isInsertSuccess = finishedInspectService.inspectionConclusion(finishedInspectId, result); |
| | | public Result<?> inspectionConclusion(@RequestHeader("token") String token,Integer finishedInspectId, Integer result) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | Integer isInsertSuccess = finishedInspectService.inspectionConclusion(data.get("name").replaceAll("\"", ""),finishedInspectId, result); |
| | | if (isInsertSuccess == 1){ |
| | | return Result.success("䏿¥æåï¼"); |
| | | } |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | Integer addProcessInspectionSheet(FinishedInspect finishedInspect); |
| | | |
| | | Integer inspectionConclusion(Integer finishedInspectId, Integer result); |
| | | Integer inspectionConclusion(String username,Integer finishedInspectId, Integer result); |
| | | |
| | | IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer inspectResult, String inspectDate, String inspectUsername); |
| | | } |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.mapper.InspectUnacceptedMapper; |
| | | import com.yuanchu.mom.mapper.RepertoryMapper; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.yuanchu.mom.mapper.FinishedInspectMapper; |
| | | import com.yuanchu.mom.pojo.InspectUnaccepted; |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | import com.yuanchu.mom.service.FinishedInspectService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.service.InspectionItemService; |
| | | import com.yuanchu.mom.service.ProductService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | @Resource |
| | | InspectUnacceptedMapper inspectUnacceptedMapper; |
| | | |
| | | @Resource |
| | | RepertoryMapper repertoryMapper; |
| | | |
| | | @Override |
| | | public Integer addProcessInspectionSheet(FinishedInspect finishedInspect) { |
| | | finishedInspect.setType(0); |
| | |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Integer inspectionConclusion(Integer finishedInspectId, Integer result) { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Integer inspectionConclusion(String username, Integer finishedInspectId, Integer result) { |
| | | //æ´æ°æ£éªåéé¢çæ£éªç»è®º |
| | | LambdaUpdateWrapper<FinishedInspect> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(FinishedInspect::getId, finishedInspectId); |
| | | updateWrapper.set(FinishedInspect::getResult, result); |
| | | finishedInspectMapper.update(new FinishedInspect(), updateWrapper); |
| | | //妿æ£éªç»è®ºä¸ºä¸åæ ¼,åéè¦æ°å¢ä¸åæ ¼æ£éªå |
| | | //妿æ£éªç»è®ºä¸ºä¸åæ ¼,åéè¦æ°å¢ä¸åæ ¼æ£éªå,è¿éè¦æ°å¢åæååºå |
| | | FinishedInspect finishedInspect = finishedInspectMapper.selectById(finishedInspectId); |
| | | if (result == 0) { |
| | | /*æ°å¢ä¸åæ ¼æ£éªå*/ |
| | | InspectUnaccepted inspectUnaccepted = InspectUnaccepted.builder() |
| | | .reason(finishedInspect.getProjectName() + "ä¸åæ ¼") //æä¸å®ä¹ä¸ºå·¥ç¨åç§°ä¸åæ ¼ |
| | | .rawInspectId(finishedInspectId) |
| | | .type(finishedInspect.getType()) |
| | | .build(); |
| | | inspectUnacceptedMapper.insert(inspectUnaccepted); |
| | | /*æ°å¢åæå(1)åºå*/ |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber()) |
| | | .eq(Repertory::getCode, finishedInspect.getMaterialCode()) |
| | | .eq(Repertory::getName, finishedInspect.getMaterial()) |
| | | .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel()) |
| | | .eq(Repertory::getUnit, finishedInspect.getUnit()) |
| | | .eq(Repertory::getType, 1); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null && rep.getCheckState()==1) { |
| | | rep.setNumber(rep.getNumber() + finishedInspect.getQuantity()); |
| | | rep.setUserName(username); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡åæååºå |
| | | Repertory repertory = Repertory.builder() |
| | | .orderCode(finishedInspect.getOrderNumber()) |
| | | .code(finishedInspect.getMaterialCode()) |
| | | .name(finishedInspect.getMaterial()) |
| | | .specifications(finishedInspect.getSpecificationsModel()) |
| | | .unit(finishedInspect.getUnit()) |
| | | .number(finishedInspect.getQuantity()) |
| | | .userName(username) |
| | | .type(1) |
| | | .checkState(1) |
| | | .build(); |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | //妿æ£éªåæ ¼,éè¦æ°å¢æå(0)åºå |
| | | if (result == 1) { |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber()) |
| | | .eq(Repertory::getCode, finishedInspect.getMaterialCode()) |
| | | .eq(Repertory::getName, finishedInspect.getMaterial()) |
| | | .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel()) |
| | | .eq(Repertory::getUnit, finishedInspect.getUnit()) |
| | | .eq(Repertory::getType, 0); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null && rep.getCheckState()==1) { |
| | | rep.setNumber(rep.getNumber() + finishedInspect.getQuantity()); |
| | | rep.setUserName(username); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡æååºå |
| | | Repertory repertory = Repertory.builder() |
| | | .orderCode(finishedInspect.getOrderNumber()) |
| | | .code(finishedInspect.getMaterialCode()) |
| | | .name(finishedInspect.getMaterial()) |
| | | .specifications(finishedInspect.getSpecificationsModel()) |
| | | .unit(finishedInspect.getUnit()) |
| | | .number(finishedInspect.getQuantity()) |
| | | .userName(username) |
| | | .type(0) |
| | | .checkState(1) |
| | | .build(); |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | rawInsProductService.saveBatch(list); |
| | | return rawInspect.getId(); |
| | | } |
| | | |
| | | //夿æ°ç»æ¯å¦å
å«0 |
| | | private static boolean containsZero(Object[] array) { |
| | | for (Object num : array) { |
| | | if (num.equals(0)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //夿æ°ç»æ¯å¦å
¨é¨ä¸º1 |
| | | private static boolean allOnes(Object[] array) { |
| | | for (Object num : array) { |
| | | if (!num.equals(1)) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | DATE_FORMAT(deal_time, '%Y-%m-%d') 'å¤çæ¥æ' |
| | | from mom_ocean.raw_inspect ri inner join mom_ocean.inspect_unaccepted ru on ri.id = ru.raw_inspect_id |
| | | <where> |
| | | <if test="dealState!=null"> |
| | | <if test="dealState!=null and dealState!=''"> |
| | | and deal_state=#{dealState} |
| | | </if> |
| | | <if test="formTime!=null"> |
| | | <if test="formTime!=null and formTime!=''"> |
| | | and form_time=#{formTime} |
| | | </if> |
| | | <if test="type!=null"> |
| | | <if test="type!=null and type!=''"> |
| | | and ru.type=#{type} |
| | | </if> |
| | | and ru.state=1 |
| | |
| | | mom_ocean.user u |
| | | where fi.id = ru.raw_inspect_id |
| | | and fi.user_id=u.id |
| | | <if test="dealState!=null"> |
| | | <if test="dealState!=null and dealState!=''"> |
| | | and deal_state=#{dealState} |
| | | </if> |
| | | <if test="formTime!=null"> |
| | | <if test="formTime!=null and formTime!=''"> |
| | | and fi.create_time=#{formTime} |
| | | </if> |
| | | <if test="type!=null"> |
| | | <if test="type!=null and type!=''"> |
| | | and ru.type=#{type} |
| | | </if> |
| | | and ru.state=1 |
| | |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.yuanchu.mom</groupId> |
| | | <artifactId>sale-server</artifactId> |
| | | <version>1.0.0</version> |
| | | </dependency> |
| | | |
| | | <!--å·¥å
·æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.yuanchu.mom</groupId> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto; |
| | | import com.yuanchu.mom.service.SaleService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.ConsignmentService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | @Api(tags = "WMS管ç-->æååè´§") |
| | | @RestController |
| | | @RequestMapping("/consignment") |
| | | public class ConsignmentController { |
| | | |
| | | @Autowired |
| | | private ConsignmentService consignmentService; |
| | | |
| | | @Resource |
| | | SaleService saleService; |
| | | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "æ°å¢æååè´§-->æ ¹æ®è®¢åå·æ¥è¯¢éå®ä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "orderNumber", value = "订åç¼å·", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/selSale") |
| | | public Result selSale(String orderNumber ) { |
| | | return Result.success(saleService.selSale(orderNumber)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æååè´§") |
| | | @PostMapping("/addCon") |
| | | public Result addCon(@RequestHeader("token") String token, @RequestBody ConsignmentDto consignmentDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(consignmentService.addCon(data.get("name").replaceAll("\"", ""), consignmentDto)); |
| | | } |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.ImportRepertory; |
| | | import com.yuanchu.mom.pojo.dto.ImportRepertoryDto; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.ImportRepertoryService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:01 |
| | | */ |
| | | @Api(tags = "WMS管ç-->æåå
¥åº") |
| | | @RestController |
| | | @RequestMapping("/importRepertory") |
| | | public class ImportRepertoryController { |
| | | |
| | | @Autowired |
| | | private ImportRepertoryService importRepertoryService; |
| | | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "æ°å¢æåå
¥åº") |
| | | @PostMapping("/addImpRep") |
| | | public Result addSale(@RequestHeader("token") String token, @RequestBody ImportRepertoryDto importRepertoryDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | importRepertoryService.addImpRep(data.get("name").replaceAll("\"", ""), importRepertoryDto); |
| | | return Result.success("æ°å¢æå!"); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢ææå
¥åºå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "orderCode", value = "订åç¼å·", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "name", value = "ææåç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "time", value = "å
¥åºæ¥æ", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllImpRep") |
| | | public Result selectAllImpRep(int pageSize, int countSize, String orderCode, String name, String time) { |
| | | IPage<Map<String, Object>> importRepertoryPage = importRepertoryService.selectAllImpRep(new Page<Object>(pageSize, countSize), orderCode, name, time); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", importRepertoryPage.getTotal()); |
| | | map.put("row", importRepertoryPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®idæ¥çå
¥åºè¯¦æ
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å
¥åºid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectImpRepById") |
| | | public Result selectImpRepById(Integer id) { |
| | | return Result.success(importRepertoryService.getById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®å
¥åºidå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å
¥åºid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delImpRep") |
| | | public Result delImpRep(Integer id) { |
| | | importRepertoryService.delImpRep(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List", required = true) |
| | | }) |
| | | @PostMapping("/delAllImpRep") |
| | | public Result delAllImpRep(@RequestParam("ids") List<Integer> ids) { |
| | | importRepertoryService.delAllImpRep(ids); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "name", value = "产ååç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "specifications", value = "产ååå·", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "time", value = "å
¥åºæ¥æ", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å(为空=å
¨é¨)", dataTypeClass = Integer.class) |
| | | @ApiImplicitParam(name = "type", value = "ç±»å(为空=å
¨é¨)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "checkState", value = "æ£éªç¶æ(为空=å
¨é¨)", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/selectAllRepertory") |
| | | public Result selectAllRepertory(int pageSize, int countSize, String name, String specifications, String time, Integer type) { |
| | | IPage<Map<String, Object>> repertoryPage = repertoryService.selectAllRepertory(new Page<Object>(pageSize, countSize), name, specifications, time, type); |
| | | public Result selectAllRepertory(int pageSize, int countSize, String name, String specifications, String time, Integer type,Integer checkState) { |
| | | IPage<Map<String, Object>> repertoryPage = repertoryService.selectAllRepertory(new Page<Object>(pageSize, countSize), name, specifications, time, type,checkState); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", repertoryPage.getTotal()); |
| | | map.put("row", repertoryPage.getRecords()); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.mom.pojo.Consignment; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | public interface ConsignmentMapper extends BaseMapper<Consignment> { |
| | | |
| | | //æ¥è¯¢ææåè´§è®°å½ |
| | | List<Consignment> selectAll(); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.ImportRepertory; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:01 |
| | | */ |
| | | public interface ImportRepertoryMapper extends BaseMapper<ImportRepertory> { |
| | | |
| | | //æ¥è¯¢å
¥åºå表 |
| | | IPage<Map<String, Object>> selectAllImpRep(Page<Object> page, String orderCode, String name, String time); |
| | | } |
| | | |
| | |
| | | public interface RepertoryMapper extends BaseMapper<Repertory> { |
| | | |
| | | //æ¥è¯¢ææåºåå表 |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type); |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer checkState); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Builder |
| | | @TableName("consignment") |
| | | public class Consignment implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * ååç¼å· |
| | | **/ |
| | | private String customerCode; |
| | | |
| | | /** |
| | | * æ¼è¿åç¼å· |
| | | **/ |
| | | private String escortCode; |
| | | |
| | | /** |
| | | * 订åç¼å· |
| | | **/ |
| | | private String orderCode; |
| | | |
| | | /** |
| | | * ææç¼ç |
| | | **/ |
| | | private String code; |
| | | |
| | | /** |
| | | * ææåç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * åå·è§æ ¼ |
| | | **/ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | private Integer number; |
| | | |
| | | /** |
| | | * ç¼å¶äººãå货人ï¼å½åç¨æ·åï¼ |
| | | **/ |
| | | private String userName; |
| | | |
| | | /** |
| | | * æ£æ¥äººå |
| | | **/ |
| | | private String checkName; |
| | | |
| | | /** |
| | | * è£
é
人å |
| | | **/ |
| | | private String fitName; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | /** |
| | | * åè´§æ¥æ |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:02 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Builder |
| | | @TableName("import_repertory") |
| | | public class ImportRepertory implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 订åç¼ç |
| | | **/ |
| | | private String orderCode; |
| | | |
| | | /** |
| | | * ææç¼ç |
| | | **/ |
| | | private String code; |
| | | |
| | | /** |
| | | * ææåç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * åå·è§æ ¼ |
| | | **/ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | private Integer number; |
| | | |
| | | /** |
| | | * å
¥åºäººï¼å½åç¨æ·åï¼ |
| | | **/ |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | /** |
| | | * å
¥åºæ¥æ |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | **/ |
| | | private String note; |
| | | } |
| | | |
| | |
| | | **/ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * è¯éªè¦æ± |
| | | **/ |
| | | private String requirements; |
| | | |
| | | /** |
| | | * å·¥èºæä»¶ç¼å· |
| | | **/ |
| | | private String documentNumber; |
| | | |
| | | /** |
| | | * åºä½å· |
| | | **/ |
| | | private Integer seat; |
| | | |
| | | /** |
| | | * åä½ |
| | |
| | | **/ |
| | | private String userName; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | /** |
| | |
| | | * ç±»å 0:æå;1:åæå |
| | | **/ |
| | | private Integer type; |
| | | |
| | | /** |
| | | *æ£éªç¶æ0:æªæ£éª;1:å·²æ£éª |
| | | **/ |
| | | private Integer checkState; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | public class ConsignmentDto { |
| | | |
| | | //订åç¼å· |
| | | @JsonSerialize |
| | | private String orderCode; |
| | | |
| | | //ååç¼å· |
| | | @JsonSerialize |
| | | private String customerCode; |
| | | |
| | | //客æ·åç§° |
| | | @JsonSerialize |
| | | private String proname; |
| | | |
| | | //å°è´§å°å |
| | | @JsonSerialize |
| | | private String adress; |
| | | |
| | | //æ¶è´§è系人 |
| | | @JsonSerialize |
| | | private String username; |
| | | |
| | | //ææºå· |
| | | @JsonSerialize |
| | | private String phone ; |
| | | |
| | | //产åä¿¡æ¯ |
| | | @JsonSerialize |
| | | private List<ConsignmentDto2> messages; |
| | | |
| | | //æ£æ¥äººå |
| | | @JsonSerialize |
| | | private String checkName; |
| | | |
| | | //è£
é
人å |
| | | @JsonSerialize |
| | | private String fitName; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ImportRepertoryDto { |
| | | /** |
| | | * 订åç¼ç |
| | | **/ |
| | | @JsonSerialize |
| | | private String orderCode; |
| | | |
| | | /** |
| | | * ææç¼ç |
| | | **/ |
| | | @JsonSerialize |
| | | private String code; |
| | | |
| | | /** |
| | | * ææåç§° |
| | | **/ |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | /** |
| | | * åå·è§æ ¼ |
| | | **/ |
| | | @JsonSerialize |
| | | private String specifications; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | @JsonSerialize |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | @JsonSerialize |
| | | private Integer number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | **/ |
| | | @JsonSerialize |
| | | private String note; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.Consignment; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | public interface ConsignmentService extends IService<Consignment> { |
| | | |
| | | /** |
| | | * æ°å¢æååè´§ |
| | | * @param name |
| | | * @param consignmentDto |
| | | */ |
| | | String addCon(String name, ConsignmentDto consignmentDto); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.ImportRepertory; |
| | | import com.yuanchu.mom.pojo.dto.ImportRepertoryDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:01 |
| | | */ |
| | | public interface ImportRepertoryService extends IService<ImportRepertory> { |
| | | |
| | | //æ°å¢æåå
¥åº |
| | | void addImpRep(String name, ImportRepertoryDto importRepertoryDto); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¥åºå表 |
| | | * @param page |
| | | * @param orderCode |
| | | * @param name |
| | | * @param time |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectAllImpRep(Page<Object> page, String orderCode, String name, String time); |
| | | |
| | | /** |
| | | * æ ¹æ®idå é¤ |
| | | * @param id |
| | | */ |
| | | void delImpRep(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllImpRep(List<Integer> ids); |
| | | } |
| | | |
| | |
| | | * @param type |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type); |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer checkState); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.ConsignmentMapper; |
| | | import com.yuanchu.mom.mapper.RepertoryMapper; |
| | | import com.yuanchu.mom.pojo.Consignment; |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto2; |
| | | import com.yuanchu.mom.service.ConsignmentService; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | @Service |
| | | public class ConsignmentServiceImpl extends ServiceImpl<ConsignmentMapper, Consignment> implements ConsignmentService { |
| | | |
| | | @Resource |
| | | ConsignmentMapper consignmentMapper; |
| | | |
| | | @Resource |
| | | RepertoryMapper repertoryMapper; |
| | | |
| | | //æ°å¢æååè´§ |
| | | @Override |
| | | public String addCon(String name, ConsignmentDto consignmentDto) { |
| | | //å¦æè¯¥è®¢åå·²ç»åè¿è´§äºä¸è½ååè´§ |
| | | List<Consignment> consignments = consignmentMapper.selectAll(); |
| | | for (Consignment consignment : consignments) { |
| | | if (consignment.getCustomerCode().equals(consignmentDto.getCustomerCode())) { |
| | | return "该åå订åå·²åè¿è´§,æ æ³å次åè´§!"; |
| | | } else { |
| | | /*æ°å¢æååè´§*/ |
| | | List<ConsignmentDto2> messages = consignmentDto.getMessages(); |
| | | for (ConsignmentDto2 message : messages) { |
| | | //æ¥è¯¢äº§åç¼ç (éè¿å¨æååºå表ä¸ç产ååç§°,è§æ ¼åå·ä»¥ååä½è¿è¡æ¥æ¾) |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getName, message.getName()) |
| | | .eq(Repertory::getSpecifications, message.getSpecifications()) |
| | | .eq(Repertory::getUnit, message.getUnit()) |
| | | .eq(Repertory::getType, 0); |
| | | Repertory repertory = repertoryMapper.selectOne(queryWrapper); |
| | | //该æåçæ£éªç¶ææ¯å·²æ£éª1æè½è¿è¡åè´§ |
| | | if (repertory.getCheckState() == 1) { |
| | | //该æååºåçæ°é大äºçäºåè´§çæ°éæè½è¿è¡åè´§ |
| | | if (repertory.getNumber() >= message.getNumber()) { |
| | | //æé æååè´§å®ä½ç±» |
| | | Consignment consig = Consignment.builder() |
| | | .customerCode(consignmentDto.getCustomerCode()) |
| | | .escortCode(MyUtil.getTimeSixNumberCode("YY")) |
| | | .orderCode(consignmentDto.getOrderCode()) |
| | | .userName(name) |
| | | .checkName(consignmentDto.getCheckName()) |
| | | .fitName(consignmentDto.getFitName()) |
| | | .name(message.getName()) |
| | | .specifications(message.getSpecifications()) |
| | | .unit(message.getUnit()) |
| | | .number(message.getNumber()) |
| | | .code(repertory.getCode()) |
| | | .build(); |
| | | consignmentMapper.insert(consig); |
| | | /*åå°å¯¹åºçåºå*/ |
| | | repertory.setNumber(repertory.getNumber() - consig.getNumber()); |
| | | repertoryMapper.updateById(repertory); |
| | | } else return "åºåä¸è¶³,æ æ³åè´§!"; |
| | | } else return "该产åè¿æªæ£éª,ä¸è½åè´§!"; |
| | | } |
| | | } |
| | | } |
| | | return "åè´§æå!"; |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.ImportRepertoryMapper; |
| | | import com.yuanchu.mom.mapper.RepertoryMapper; |
| | | import com.yuanchu.mom.pojo.ImportRepertory; |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | import com.yuanchu.mom.pojo.dto.ImportRepertoryDto; |
| | | import com.yuanchu.mom.service.ImportRepertoryService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:01 |
| | | */ |
| | | @Service |
| | | public class ImportRepertoryServiceImpl extends ServiceImpl<ImportRepertoryMapper, ImportRepertory> implements ImportRepertoryService { |
| | | |
| | | @Resource |
| | | ImportRepertoryMapper importRepertoryMapper; |
| | | |
| | | @Resource |
| | | RepertoryMapper repertoryMapper; |
| | | |
| | | //æ°å¢æåå
¥åº |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addImpRep(String name, ImportRepertoryDto importRepertoryDto) { |
| | | //æ°å¢æåå
¥åº |
| | | ImportRepertory importRepertory = new ImportRepertory(); |
| | | BeanUtils.copyProperties(importRepertoryDto, importRepertory); |
| | | importRepertory.setUserName(name); |
| | | importRepertoryMapper.insert(importRepertory); |
| | | //æ°å¢æååºå |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, importRepertoryDto.getOrderCode()) |
| | | .eq(Repertory::getCode, importRepertoryDto.getCode()) |
| | | .eq(Repertory::getName, importRepertoryDto.getName()) |
| | | .eq(Repertory::getSpecifications, importRepertoryDto.getSpecifications()) |
| | | .eq(Repertory::getUnit, importRepertoryDto.getUnit()) |
| | | .eq(Repertory::getType, 0); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null && rep.getCheckState() == 0) { |
| | | rep.setNumber(rep.getNumber() + importRepertoryDto.getNumber()); |
| | | rep.setUserName(name); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡æååºå |
| | | Repertory repertory = new Repertory(); |
| | | BeanUtils.copyProperties(importRepertoryDto, repertory); |
| | | repertory.setUserName(name); |
| | | repertory.setType(0); |
| | | repertory.setCheckState(0); |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | |
| | | //æ¥è¯¢å
¥åºå表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllImpRep(Page<Object> page, String orderCode, String name, String time) { |
| | | return importRepertoryMapper.selectAllImpRep(page, orderCode, name, time); |
| | | } |
| | | |
| | | //æ ¹æ®idå é¤ |
| | | @Override |
| | | public void delImpRep(Integer id) { |
| | | //å é¤å
¥åºè®°å½ |
| | | ImportRepertory importRepertory = importRepertoryMapper.selectById(id); |
| | | importRepertory.setState(0); |
| | | importRepertoryMapper.updateById(importRepertory); |
| | | //åºåä¹è¦åå° |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, importRepertory.getOrderCode()) |
| | | .eq(Repertory::getCode, importRepertory.getCode()) |
| | | .eq(Repertory::getName, importRepertory.getName()) |
| | | .eq(Repertory::getSpecifications, importRepertory.getSpecifications()) |
| | | .eq(Repertory::getUnit, importRepertory.getUnit()) |
| | | .eq(Repertory::getType, 0) |
| | | .eq(Repertory::getCheckState, 0); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | rep.setNumber(rep.getNumber() - importRepertory.getNumber()); |
| | | repertoryMapper.updateById(rep); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllImpRep(List<Integer> ids) { |
| | | List<ImportRepertory> importRepertories = importRepertoryMapper.selectBatchIds(ids); |
| | | for (ImportRepertory importRepertory : importRepertories) { |
| | | importRepertory.setState(0); |
| | | //å é¤å
¥åºè®°å½ |
| | | importRepertoryMapper.updateById(importRepertory); |
| | | //åå°åºå |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, importRepertory.getOrderCode()) |
| | | .eq(Repertory::getCode, importRepertory.getCode()) |
| | | .eq(Repertory::getName, importRepertory.getName()) |
| | | .eq(Repertory::getSpecifications, importRepertory.getSpecifications()) |
| | | .eq(Repertory::getUnit, importRepertory.getUnit()) |
| | | .eq(Repertory::getType, 0) |
| | | .eq(Repertory::getCheckState, 0); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | rep.setNumber(rep.getNumber() - importRepertory.getNumber()); |
| | | repertoryMapper.updateById(rep); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //æ¥è¯¢ææåºåå表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type) { |
| | | return repertoryMapper.selectAllRepertory(page,name,specifications,time,type); |
| | | public IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer checkState) { |
| | | return repertoryMapper.selectAllRepertory(page,name,specifications,time,type,checkState); |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.yuanchu.mom.mapper.ConsignmentMapper"> |
| | | <select id="selectAll" resultType="com.yuanchu.mom.pojo.Consignment"> |
| | | select * from mom_ocean.consignment where state=1 |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.yuanchu.mom.mapper.ImportRepertoryMapper"> |
| | | <select id="selectAllImpRep" resultType="java.util.Map"> |
| | | select id, |
| | | order_code, |
| | | code, |
| | | name, |
| | | specifications, |
| | | unit, |
| | | number, |
| | | user_name, |
| | | create_time |
| | | from mom_ocean.import_repertory |
| | | where state=1 |
| | | <if test="orderCode!=null and orderCode!=''"> |
| | | and order_code like concat('%',#{orderCode},'%') |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="time!=null and time!=''"> |
| | | and create_time=#{time} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | name, |
| | | specifications, |
| | | code, |
| | | requirements, |
| | | order_code, |
| | | seat, |
| | | check_state, |
| | | user_name, |
| | | DATE_FORMAT(create_time, '%Y-%m-%d') 'å
¥åºæ¥æ', |
| | | note |
| | | from mom_ocean.repertory |
| | | <where> |
| | | and state=1 |
| | | <if test="name!=null"> |
| | | and name =#{name} |
| | | <if test="name!=null and name!=''"> |
| | | and name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="specifications!=null "> |
| | | and specifications=#{specifications} |
| | | <if test="specifications!=null and specifications!=''"> |
| | | and specifications LIKE CONCAT('%',#{specifications},'%') |
| | | </if> |
| | | <if test="time!=null "> |
| | | <if test="time!=null and time!=''"> |
| | | and create_time=#{time} |
| | | </if> |
| | | <if test="type!=null"> |
| | | <if test="type!=null and type!=''"> |
| | | and type=#{type} |
| | | </if> |
| | | <if test="checkState!=null and checkState!=''"> |
| | | and check_state=#{checkState} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <artifactId>standard-server</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.yuanchu.mom</groupId> |
| | | <artifactId>inventory-server</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.yuanchu.mom</groupId> |
| | | <artifactId>user-server</artifactId> |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.lang.reflect.Array; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "éå®åid", dataTypeClass = String.class, dataType = "List", required = true) |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List",required = true) |
| | | }) |
| | | @PostMapping("/delAllSale") |
| | | public Result delAllSale( List<Integer> ids) { |
| | | public Result delAllSale( @RequestParam("ids") List<Integer> ids) { |
| | | saleService.delAllSale(ids); |
| | | return Result.success(); |
| | | } |
| | |
| | | |
| | | //æ¥è¯¢éå®åå表 |
| | | IPage<Map<String, Object>> selectSaleList(Page<Object> page, String orderNumber, String name, Integer type, String delTime); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private Date checkTime; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | private String price; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @Builder |
| | | public class ConsignmentDto1 { |
| | | |
| | | //订åç¼å· |
| | | @JsonSerialize |
| | | private String orderCode; |
| | | |
| | | //ååç¼å· |
| | | @JsonSerialize |
| | | private String customerCode; |
| | | |
| | | //客æ·åç§° |
| | | @JsonSerialize |
| | | private String proname; |
| | | |
| | | //å°è´§å°å |
| | | @JsonSerialize |
| | | private String adress; |
| | | |
| | | //æ¶è´§è系人 |
| | | @JsonSerialize |
| | | private String username; |
| | | |
| | | //ææºå· |
| | | @JsonSerialize |
| | | private String phone ; |
| | | |
| | | //产åä¿¡æ¯ |
| | | @JsonSerialize |
| | | private List<ConsignmentDto2> messages; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | public class ConsignmentDto2 { |
| | | |
| | | //产åä¿¡æ¯ |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | //è§æ ¼åå· |
| | | @JsonSerialize |
| | | private String specifications; |
| | | |
| | | //åä½ |
| | | @JsonSerialize |
| | | private String unit; |
| | | |
| | | //åè´§æ°é |
| | | @JsonSerialize |
| | | private Integer number; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.Sale; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto1; |
| | | import com.yuanchu.mom.pojo.dto.SaleDto; |
| | | import com.yuanchu.mom.pojo.dto.vo.SaleVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param id |
| | | */ |
| | | void check(String checkname,Integer id,Integer type); |
| | | |
| | | /** |
| | | *æ ¹æ®è®¢åå·æ¥è¯¢éå®ä¿¡æ¯ |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | | ConsignmentDto1 selSale(String orderNumber); |
| | | } |
| | |
| | | import com.yuanchu.mom.pojo.Sale; |
| | | import com.yuanchu.mom.mapper.SaleMapper; |
| | | import com.yuanchu.mom.pojo.SaleMaterial; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto1; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto2; |
| | | import com.yuanchu.mom.pojo.dto.SaleDto; |
| | | import com.yuanchu.mom.pojo.dto.SaleMaterialDto; |
| | | import com.yuanchu.mom.pojo.dto.vo.SaleVo; |
| | | import com.yuanchu.mom.service.SaleMaterialService; |
| | | import com.yuanchu.mom.service.SaleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | sale.setCheckTime(new Date()); |
| | | saleMapper.updateById(sale); |
| | | } |
| | | |
| | | //æ ¹æ®è®¢åå·æ¥è¯¢éå®ä¿¡æ¯ |
| | | @Override |
| | | public ConsignmentDto1 selSale(String orderNumber) { |
| | | Sale sale = saleMapper.selectOne(Wrappers.<Sale>query().eq("order_number", orderNumber)); |
| | | List<SaleMaterial> saleMaterials = saleMaterialMapper.selectList(Wrappers.<SaleMaterial>query().eq("sale_id", sale.getId())); |
| | | List<ConsignmentDto2> dto2List = saleMaterials.stream().map(saleMaterial -> { |
| | | ConsignmentDto2 consignmentDto2 = new ConsignmentDto2(); |
| | | BeanUtils.copyProperties(saleMaterial, consignmentDto2); |
| | | return consignmentDto2; |
| | | }).collect(Collectors.toList()); |
| | | ConsignmentDto1 consignmentDto1 = ConsignmentDto1.builder() |
| | | .orderCode(orderNumber) |
| | | .customerCode(sale.getCode()) |
| | | .proname(sale.getProname()) |
| | | .adress(sale.getAdress()) |
| | | .username(sale.getUsername()) |
| | | .phone(sale.getPhone()) |
| | | .messages(dto2List) |
| | | .build(); |
| | | return consignmentDto1; |
| | | } |
| | | } |
| | |
| | | from mom_ocean.sale |
| | | <where> |
| | | state=1 |
| | | <if test="orderNumber!=null"> |
| | | and order_number=#{orderNumber} |
| | | <if test="orderNumber!=null and orderNumber!=''"> |
| | | and order_number LIKE CONCAT('%',#{orderNumber},'%') |
| | | </if> |
| | | <if test="name!=null"> |
| | | and name=#{name} |
| | | <if test="name!=null and name!=''"> |
| | | and name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="type!=null"> |
| | | <if test="type!=null and type!=''"> |
| | | and type=#{type} |
| | | </if> |
| | | <if test="delTime!=null"> |
| | | <if test="delTime!=null and delTime!=''"> |
| | | and DATE_FORMAT(delTime, '%Y-%m-%d')=#{delTime} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.SaleMaterialMapper"> |
| | | <select id="selectSaleDatil" resultType="com.yuanchu.mom.pojo.SaleMaterial"> |
| | | select id, name, specifications, unit, number, price, state, create_time, update_time, sale_id |
| | | select id, |
| | | name, |
| | | specifications, |
| | | unit, |
| | | number, |
| | | price, |
| | | state, |
| | | create_time, |
| | | update_time, |
| | | sale_id |
| | | from mom_ocean.sale_material |
| | | where state=1 |
| | | <if test="id!=null"> |
| | | and sale_id=#{id} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "éå®åid", dataTypeClass = String.class, dataType = "List", required = true) |
| | | @ApiImplicitParam(name = "ids", value = "éå®åid", dataTypeClass = Integer.class, dataType = "List", required = true) |
| | | }) |
| | | @PostMapping("/delAllTech") |
| | | public Result delAllTech( List<Integer> ids) { |
| | | public Result delAllTech(@RequestParam("ids") List<Integer> ids) { |
| | | technologyTemplateService.delAllTech(ids); |
| | | return Result.success("æ¹éå 餿å!"); |
| | | } |
| | |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | o.state |
| | | from mom_ocean.orders o,mom_ocean.material m |
| | | <where> |
| | | <if test="orderCode != null"> |
| | | and order_code = #{orderCode} |
| | | <if test="orderCode != null and orderCode!=''"> |
| | | and order_code LIKE CONCAT('%',#{orderCode},'%') |
| | | </if> |
| | | <if test="time != null"> |
| | | <if test="time != null and time!=''"> |
| | | and o.create_time = #{time} |
| | | </if> |
| | | <if test="name != null"> |
| | | and m.name = #{name} |
| | | <if test="name != null and name!=''"> |
| | | and m.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="state != null"> |
| | | <if test="state != null and state!=''"> |
| | | and o.state = #{state} |
| | | </if> |
| | | and o.code=m.code |
| | |
| | | from mom_ocean.technology_template t |
| | | <where> |
| | | state=1 |
| | | <if test="type!=null"> |
| | | <if test="type!=null and type!=''"> |
| | | and type=#{type} |
| | | </if> |
| | | <if test="element!=null"> |
| | | <if test="element!=null and element!=''"> |
| | | and element like concat('%',#{element},'%') |
| | | </if> |
| | | <if test="father!=null"> |
| | | <if test="father!=null and father!=''"> |
| | | and father like concat('%',#{father},'%') |
| | | </if> |
| | | </where> |