dev
This commit is contained in:
parent
95de13fe46
commit
d128d8dede
|
|
@ -141,4 +141,20 @@ public class GoodsController extends BaseController {
|
|||
return success(goodsService.getByCateId(cateId));
|
||||
|
||||
}
|
||||
/**
|
||||
* 停售
|
||||
*/
|
||||
@RequestMapping("disableSale")
|
||||
public Result<Goods> disableSale() {
|
||||
Integer id = parmsUtil.getInteger("id", "id不存在");
|
||||
return success(goodsService.disableSale(id));
|
||||
}
|
||||
/**
|
||||
* 启售商品
|
||||
*/
|
||||
@RequestMapping("enableSale")
|
||||
public Result<Goods> enableSale() {
|
||||
Integer id = parmsUtil.getInteger("id", "id不存在");
|
||||
return success(goodsService.enableSale(id));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
|
|||
* </p>
|
||||
*
|
||||
* @author NiuZiYuan
|
||||
* @since 2025-05-07
|
||||
* @since 2025-05-09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -135,4 +135,7 @@ public class Goods implements Serializable {
|
|||
|
||||
@ApiModelProperty("拼音首字母")
|
||||
private String pinyinFirst;
|
||||
|
||||
@ApiModelProperty("销售状态")
|
||||
private Boolean saleStatus;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,9 +69,8 @@ public class GoodsDetailVo {
|
|||
|
||||
private Integer makeUp;
|
||||
|
||||
private Boolean status;
|
||||
|
||||
private String cateName;
|
||||
private Boolean saleStatus;
|
||||
|
||||
//最近效期
|
||||
private LocalDate recentlyExpiryDate ;
|
||||
|
|
@ -83,4 +82,6 @@ public class GoodsDetailVo {
|
|||
private BigDecimal selfpayProp;
|
||||
//限制说明
|
||||
private String hilistLmtpricType;
|
||||
//甲乙丙类
|
||||
private String chrgitmLv;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,9 +99,6 @@ public class GoodsSearchVo {
|
|||
@ApiModelProperty("加成率 30=30%")
|
||||
private Integer makeUp;
|
||||
|
||||
@ApiModelProperty("0禁售 1可售")
|
||||
private Boolean status;
|
||||
|
||||
@ApiModelProperty("库存预警数量")
|
||||
private Integer inventoryWarnNumber;
|
||||
|
||||
|
|
@ -111,6 +108,9 @@ public class GoodsSearchVo {
|
|||
@ApiModelProperty("使用次数")
|
||||
private Integer useNum;
|
||||
|
||||
@ApiModelProperty("销售状态")
|
||||
private Boolean saleStatus;
|
||||
|
||||
@ApiModelProperty("全拼")
|
||||
private String pinyinFull;
|
||||
|
||||
|
|
|
|||
|
|
@ -68,11 +68,13 @@ public class SocialDirectoryView implements Serializable {
|
|||
|
||||
private String pinyin;
|
||||
private String lmtUsedFlag;
|
||||
private String chrgitmLv;
|
||||
private JSONObject json;
|
||||
|
||||
|
||||
private String minPackagingUnit;
|
||||
private String packagingUnit;
|
||||
|
||||
private Integer inventoryWholeNumber;
|
||||
private Integer inventoryFragmentNumber;
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ public class GoodsService {
|
|||
* @param goods 商品信息
|
||||
*/
|
||||
public Goods createGoods(Goods goods) {
|
||||
GoodsPricingModelEnum modelEnum = GoodsPricingModelEnum.getByPricingModel(goods.getPricingModel());
|
||||
if (modelEnum == null){
|
||||
throw new MessageException("定价模式错误错误");
|
||||
}
|
||||
|
||||
if (goods.getPricingModel().equals(GoodsPricingModelEnum.Bonus.getPricingModel()) && goods.getMakeUp() == null) {
|
||||
throw new MessageException("售价为进价加成时,加成率不能为空");
|
||||
|
|
@ -239,6 +243,8 @@ public class GoodsService {
|
|||
goodsDetailVo.setHilistPricUplmtAmt(dbSocialInfo.getHilistPricUplmtAmt());
|
||||
goodsDetailVo.setHilistLmtpricType(dbSocialInfo.getHilistLmtpricType());
|
||||
goodsDetailVo.setSelfpayProp(dbSocialInfo.getSelfpayProp());
|
||||
ChrgitmLvEnum chrgitmLvEnum = ChrgitmLvEnum.getChrgitmLvEnumByCode(dbSocialInfo.getChrgitmLv());
|
||||
goodsDetailVo.setChrgitmLv(chrgitmLvEnum==null?null:chrgitmLvEnum.getName());
|
||||
}
|
||||
goodsDetailVoList.add(goodsDetailVo);
|
||||
|
||||
|
|
@ -436,4 +442,43 @@ public class GoodsService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁售商品
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public Goods disableSale(Integer id) {
|
||||
return changeGoodsSaleStatus(id, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 起售商品
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public Goods enableSale(Integer id) {
|
||||
return changeGoodsSaleStatus(id, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 改变商品销售状态
|
||||
* @param id
|
||||
* @param target
|
||||
* @return
|
||||
*/
|
||||
private Goods changeGoodsSaleStatus(Integer id , boolean target){
|
||||
Goods dbGoods = goodsMapper.selectById(id);
|
||||
if (dbGoods == null){
|
||||
throw new MessageException("商品不存在");
|
||||
}
|
||||
if (dbGoods.getSaleStatus() == target){
|
||||
return dbGoods;
|
||||
}
|
||||
UpdateWrapper<Goods> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("sale_status", false);
|
||||
updateWrapper.eq("id", id);
|
||||
goodsMapper.update(null, updateWrapper);
|
||||
dbGoods.setSaleStatus(target);
|
||||
return dbGoods;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ public class SocialDirectoryService extends BaseService {
|
|||
socialDirectoryView.setSelfpayPropType(socialDirectorySelf.getSelfpayPropType());
|
||||
socialDirectoryView.setSelfpayProp(socialDirectorySelf.getSelfpayProp());
|
||||
}
|
||||
socialDirectoryView.setJson(JSONObject.parseObject(socialDirectory.getData()));
|
||||
socialDirectoryViewList.add(socialDirectoryView);
|
||||
}
|
||||
Page<SocialDirectoryView> result = new Page<>();
|
||||
|
|
@ -347,6 +348,7 @@ public class SocialDirectoryService extends BaseService {
|
|||
socialDirectoryView.setWubi(socialDirectoryUpinfo.getWubi());
|
||||
socialDirectoryView.setPinyin(socialDirectoryUpinfo.getPinyin());
|
||||
socialDirectoryView.setLmtUsedFlag(socialDirectoryUpinfo.getLmtUsedFlag());
|
||||
socialDirectoryView.setChrgitmLv(socialDirectoryUpinfo.getChrgitmLv());
|
||||
}
|
||||
SocialDirectoryLimit socialDirectoryLimit = socialDirectoryLimitMapper.selectByCode(code);
|
||||
if (socialDirectoryLimit != null) {
|
||||
|
|
|
|||
|
|
@ -443,8 +443,7 @@ public class SocialInventoryUploadService extends BaseService {
|
|||
|
||||
ChargeOrder chargeOrder = chargeOrderMapper.selectOne(new QueryWrapper<ChargeOrder>()
|
||||
.eq("code", orderInventory.getChargeOrderCode()).last("limit 1"));
|
||||
ManagerUser salePerson = managerUserMapper.selectById(chargeOrder.getSalePersonId());
|
||||
OrganizationMember docker = organizationMemberMapper.selectById(salePerson.getOrganizationMemberId());
|
||||
OrganizationMember docker = organizationMemberMapper.selectById(chargeOrder.getSalePersonId());
|
||||
|
||||
|
||||
Goods goods = goodsMapper.selectById(inventory.getGoodId());
|
||||
|
|
@ -487,7 +486,7 @@ public class SocialInventoryUploadService extends BaseService {
|
|||
im3505.setRtalDocno(orderInventory.getChargeOrderCode());
|
||||
im3505.setSelRetnTime(LocalDate.from(orderInventory.getCreateTime()));
|
||||
im3505.setSelRetnCnt(BigDecimal.valueOf(orderInventory.getNumber()));
|
||||
im3505.setSelRetnOpterName(salePerson.getName());
|
||||
im3505.setSelRetnOpterName(docker.getName());
|
||||
List<Map<String,String>> drugtracinfo = new ArrayList<>();
|
||||
im3505.setDrugtracinfo(drugtracinfo);
|
||||
socialRequest.call3505(im3505);
|
||||
|
|
@ -522,9 +521,8 @@ public class SocialInventoryUploadService extends BaseService {
|
|||
im3506.setTrdnFlag(orderInventory.getTrdnFlag()?"0":"1");
|
||||
|
||||
im3506.setSelRetnCnt(BigDecimal.valueOf(orderInventory.getNumber()));
|
||||
im3506.setSelRetnOpterName(salePerson.getName());
|
||||
im3506.setSelRetnOpterName(docker.getName());
|
||||
im3506.setSelRetnTime(LocalDateTime.now());
|
||||
im3506.setSelRetnOpterName(salePerson.getName());
|
||||
List<Map<String,String>> drugtracinfo = new ArrayList<>();
|
||||
im3506.setDrugtracinfo(drugtracinfo);
|
||||
socialRequest.call3506(im3506);
|
||||
|
|
|
|||
Loading…
Reference in New Issue