11.26超市
parent
9bc401daa5
commit
3405fac928
|
@ -22,7 +22,6 @@ public class Import {
|
|||
private Integer merchName;
|
||||
private String merchType;
|
||||
private BigDecimal merchPrice;
|
||||
private String barCode;
|
||||
private BigDecimal salesProPrice;
|
||||
private Date merchDeadTime;
|
||||
private Integer merchNum;
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.bwie.common.domain;
|
|||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName Merch
|
||||
|
@ -17,9 +16,8 @@ public class Merch {
|
|||
private String merchName;
|
||||
private String merchType;
|
||||
private BigDecimal merchPrice;
|
||||
private String barCode;
|
||||
private BigDecimal salesProPrice;
|
||||
private Date merchDeadTime;
|
||||
private Integer merchDeadTime;
|
||||
private Integer merchNum;
|
||||
private Integer merchSta;
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.bwie.common.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @ClassName MerchInser
|
||||
* @Description 描述
|
||||
* @Author XingHua.Han
|
||||
* @Date 2023/11/26 15:27
|
||||
*/
|
||||
@Data
|
||||
public class MerchInsert {
|
||||
private String merchName;
|
||||
private String merchType;
|
||||
private BigDecimal merchPrice;
|
||||
private BigDecimal salesProPrice;
|
||||
private Integer merchDeadTime;
|
||||
}
|
|
@ -3,7 +3,6 @@ package com.bwie.common.domain.dto;
|
|||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName MerchUpd
|
||||
|
@ -19,5 +18,5 @@ public class MerchUpd {
|
|||
private BigDecimal merchPrice;
|
||||
private String barCode;
|
||||
private BigDecimal salesProPrice;
|
||||
private Date merchDeadTime;
|
||||
private Integer merchDeadTime;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package com.bwie.merch.controller;
|
||||
|
||||
import com.bwie.common.domain.dto.MerchIns;
|
||||
import com.bwie.common.domain.dto.MerchInsert;
|
||||
import com.bwie.common.domain.dto.MerchRestock;
|
||||
import com.bwie.common.domain.dto.MerchUpd;
|
||||
import com.bwie.common.result.Result;
|
||||
import com.bwie.merch.service.MerchService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -31,7 +33,7 @@ public class MerchController {
|
|||
return result;
|
||||
}
|
||||
@PostMapping("delete/{merchId}")
|
||||
public Result delete(@RequestBody String merchId){
|
||||
public Result delete(@PathVariable String merchId){
|
||||
Result result = merchService.delete(merchId);
|
||||
return result;
|
||||
}
|
||||
|
@ -40,8 +42,13 @@ public class MerchController {
|
|||
Result result = merchService.update(merchUpd);
|
||||
return result;
|
||||
}
|
||||
@PostMapping("listing/merchId")
|
||||
public Result listing(@RequestBody String merchId){
|
||||
@PostMapping("findByMerchId/{merchId}")
|
||||
public Result findByMerchId(@PathVariable String merchId){
|
||||
Result result = merchService.findByMerchId(merchId);
|
||||
return result;
|
||||
}
|
||||
@PostMapping("listing/{merchId}")
|
||||
public Result listing(@PathVariable String merchId){
|
||||
Result result = merchService.listing(merchId);
|
||||
return result;
|
||||
}
|
||||
|
@ -55,4 +62,9 @@ public class MerchController {
|
|||
Result result = merchService.importAllShow();
|
||||
return result;
|
||||
}
|
||||
@PostMapping("insertMerch")
|
||||
public Result insertMerch(@RequestBody MerchInsert merchInsert){
|
||||
Result result = merchService.insertImport(merchInsert);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.bwie.merch.mapper;
|
|||
import com.bwie.common.domain.Import;
|
||||
import com.bwie.common.domain.Merch;
|
||||
import com.bwie.common.domain.dto.MerchIns;
|
||||
import com.bwie.common.domain.dto.MerchInsert;
|
||||
import com.bwie.common.domain.dto.MerchRestock;
|
||||
import com.bwie.common.domain.dto.MerchUpd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
@ -37,4 +38,6 @@ public interface MerchMapper {
|
|||
void insertImport(MerchRestock merchRestock);
|
||||
|
||||
List<Import> importAllShow();
|
||||
|
||||
void insertMarch(MerchInsert merchInsert);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.bwie.merch.service;
|
||||
|
||||
import com.bwie.common.domain.dto.MerchIns;
|
||||
import com.bwie.common.domain.dto.MerchInsert;
|
||||
import com.bwie.common.domain.dto.MerchRestock;
|
||||
import com.bwie.common.domain.dto.MerchUpd;
|
||||
import com.bwie.common.result.Result;
|
||||
|
@ -27,4 +28,8 @@ public interface MerchService {
|
|||
Result restock(MerchRestock merchRestock);
|
||||
|
||||
Result importAllShow();
|
||||
|
||||
Result findByMerchId(String merchId);
|
||||
|
||||
Result insertImport(MerchInsert merchInsert);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.bwie.merch.service.impl;
|
|||
import com.bwie.common.domain.Import;
|
||||
import com.bwie.common.domain.Merch;
|
||||
import com.bwie.common.domain.dto.MerchIns;
|
||||
import com.bwie.common.domain.dto.MerchInsert;
|
||||
import com.bwie.common.domain.dto.MerchRestock;
|
||||
import com.bwie.common.domain.dto.MerchUpd;
|
||||
import com.bwie.common.result.Result;
|
||||
|
@ -71,4 +72,16 @@ public class MerchServiceImpl implements MerchService {
|
|||
List<Import> list = merchMapper.importAllShow();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result findByMerchId(String merchId) {
|
||||
Merch merch = merchMapper.findById(merchId);
|
||||
return Result.success(merch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result insertImport(MerchInsert merchInsert) {
|
||||
merchMapper.insertMarch(merchInsert);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
(`merch_name`,
|
||||
`merch_type`,
|
||||
`merch_price`,
|
||||
`bar_code`,
|
||||
`sales_pro_price`,
|
||||
`merch_dead_time`,
|
||||
`merch_num`,
|
||||
|
@ -20,7 +19,6 @@
|
|||
VALUES (#{merchName},
|
||||
#{merchType},
|
||||
#{merchPrice},
|
||||
#{barCode},
|
||||
#{salesProPrice},
|
||||
#{merchDeadTime},
|
||||
0,
|
||||
|
@ -32,13 +30,29 @@
|
|||
VALUES ( #{merchId}, #{restockNum}, now());
|
||||
|
||||
</insert>
|
||||
<insert id="insertMarch">
|
||||
INSERT INTO `zhuangao5`.`t_merch`
|
||||
(`merch_name`,
|
||||
`merch_type`,
|
||||
`merch_price`,
|
||||
`sales_pro_price`,
|
||||
`merch_dead_time`,
|
||||
merch_sta
|
||||
)
|
||||
VALUES (#{merchName},
|
||||
#{merchType},
|
||||
#{merchPrice},
|
||||
#{salesProPrice},
|
||||
#{merchDeadTime},
|
||||
1
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update t_merch set
|
||||
merch_name=#{merchName},
|
||||
merch_type=#{merchType},
|
||||
merch_price=#{merchPrice},
|
||||
bar_code=#{barCode},
|
||||
sales_pro_price=#{salesProPrice},
|
||||
merch_dead_time=#{merchDeadTime}
|
||||
where
|
||||
|
|
Loading…
Reference in New Issue