|
|
@ -2,6 +2,7 @@ package com.yxt.ordermall.biz.lpkgoods; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
@ -21,21 +22,36 @@ import com.yxt.ordermall.api.shoppingcart.ShoppingCart; |
|
|
|
import com.yxt.ordermall.api.shoppingcart.ShoppingCartQuery; |
|
|
|
import com.yxt.ordermall.api.shoppingcart.ShoppingCartVo; |
|
|
|
import com.yxt.ordermall.biz.enterprisecertification.EnterpriseCertificationService; |
|
|
|
import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoVo; |
|
|
|
import com.yxt.ordermall.biz.func.basegoodssku.*; |
|
|
|
import com.yxt.ordermall.biz.func.basegoodsskuextend.BaseGoodsSkuExtendDto; |
|
|
|
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuDto; |
|
|
|
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuVo; |
|
|
|
import com.yxt.ordermall.biz.func.basegoodsspudetail.BaseGoodsSpuDetailDto; |
|
|
|
import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeQuery; |
|
|
|
import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeVo; |
|
|
|
import com.yxt.ordermall.biz.func.commonmethod.CommonMethod; |
|
|
|
import com.yxt.ordermall.biz.func.commonmethod.DataRule; |
|
|
|
import com.yxt.ordermall.biz.lpkcustomer.LpkCustomerService; |
|
|
|
import com.yxt.ordermall.biz.shoppingcart.ShoppingCartService; |
|
|
|
import com.yxt.ordermall.feign.base.basebrandinfo.BaseBrandInfoFeign; |
|
|
|
import com.yxt.ordermall.feign.base.basegoodssku.BaseGoodsSkuFeign; |
|
|
|
import com.yxt.ordermall.feign.base.basegoodsspu.BaseGoodsSpuFeign; |
|
|
|
import com.yxt.ordermall.feign.base.basegoodstype.BaseGoodsTypeFeign; |
|
|
|
import com.yxt.ordermall.mallplus.biz.pms.service.IPmsBrandService; |
|
|
|
import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand; |
|
|
|
import com.yxt.ordermall.mallplus.mbg.pms.entity.brand.BrandVo; |
|
|
|
import com.yxt.ordermall.utils.DoubleUtils; |
|
|
|
import com.yxt.ordermall.utils.OrgPathQuery; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
import java.awt.event.InputEvent; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.*; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
@ -55,77 +71,162 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
LpkCustomerService lpkCustomerService; |
|
|
|
@Autowired |
|
|
|
EnterpriseCertificationService enterpriseCertificationService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
CommonMethod commonMethod; |
|
|
|
@Autowired |
|
|
|
BaseGoodsSkuFeign baseGoodsSkuFeign; |
|
|
|
@Autowired |
|
|
|
BaseGoodsSpuFeign baseGoodsSpuFeign; |
|
|
|
@Autowired |
|
|
|
BaseGoodsTypeFeign baseGoodsTypeFeign; |
|
|
|
@Autowired |
|
|
|
BaseBrandInfoFeign baseBrandInfoFeign; |
|
|
|
|
|
|
|
public ResultBean<PagerVo<LpkGoodsVo>> goodsListPage(PagerQuery<LpkGoodsQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
LpkGoodsQuery query = pq.getParams(); |
|
|
|
QueryWrapper<LpkGoods> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("1", "1"); |
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
|
qw.like("name", query.getName()); |
|
|
|
} |
|
|
|
qw.orderByAsc("sort"); |
|
|
|
IPage<LpkGoods> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<LpkGoodsVo> pagging = baseMapper.goodsListPage(page, qw); |
|
|
|
PagerVo<LpkGoodsVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
List<LpkGoodsVo> records = pagging.getRecords(); |
|
|
|
records.removeAll(Collections.singleton(null)); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
for (LpkGoodsVo record : records) { |
|
|
|
if (StringUtils.isNotBlank(record.getPicUrl())) { |
|
|
|
record.setPicUrl(fileUploadComponent.getUrlPrefix() + record.getPicUrl()); |
|
|
|
} |
|
|
|
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData(); |
|
|
|
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId()); |
|
|
|
pq.getParams().setIndex(dataRule.getIndex()); |
|
|
|
PagerQuery<BaseGoodsSkuQuery> baseGoodsSkuQueryPagerQuery=new PagerQuery<>(); |
|
|
|
BeanUtil.copyProperties(pq,baseGoodsSkuQueryPagerQuery); |
|
|
|
ResultBean<PagerVo<GoodsSkuVo1>>sku= baseGoodsSkuFeign.listPage(baseGoodsSkuQueryPagerQuery); |
|
|
|
List<LpkGoodsVo> records = new ArrayList<>(); |
|
|
|
PagerVo vo=new PagerVo(); |
|
|
|
BeanUtil.copyProperties(sku.getData(),vo); |
|
|
|
LpkGoodsVo vv=new LpkGoodsVo(); |
|
|
|
for (GoodsSkuVo1 record : sku.getData().getRecords()) { |
|
|
|
vv.setCreateTime(new Date()); |
|
|
|
vv.setCode(record.getGoodsCode()); |
|
|
|
vv.setPrice(record.getSalesPrice()); |
|
|
|
vv.setBarcode(record.getBarCode()); |
|
|
|
vv.setName(record.getGoodsName()); |
|
|
|
vv.setWeight(record.getTitle()); |
|
|
|
vv.setUnitName(record.getUnitName()); |
|
|
|
vv.setPrice(record.getSalesPrice()); |
|
|
|
vv.setBrandId(record.getBrandSid()); |
|
|
|
vv.setBrandName(record.getBrandName()); |
|
|
|
vv.setCategoryId(record.getTypeSid()); |
|
|
|
vv.setCategoryName(record.getGoodsTypeName()); |
|
|
|
vv.setSort(record.getSortNo()); |
|
|
|
vv.setSid(record.getSkuSid()); |
|
|
|
if (StringUtils.isNotBlank(record.getPicUrl())) { |
|
|
|
vv.setPicUrl(fileUploadComponent.getUrlPrefix() + record.getPicUrl()); |
|
|
|
} |
|
|
|
LpkGoods lpkGoods = baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("skuSid", vv.getSid())); |
|
|
|
vv.setIsAppletGrounding(lpkGoods.getIsAppletGrounding()); |
|
|
|
vv.setUseTo(lpkGoods.getUseTo()); |
|
|
|
records.add(vv); |
|
|
|
} |
|
|
|
return rb.success().setData(p); |
|
|
|
vo.setRecords(records); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<String> saveGoods(LpkGoodsDto dto) { |
|
|
|
public ResultBean saveGoods(LpkGoodsDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String sid = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getSid())) { |
|
|
|
sid = dto.getSid(); |
|
|
|
LpkGoods lpkGoods = fetchBySid(dto.getSid()); |
|
|
|
BeanUtil.copyProperties(dto, lpkGoods, "id", "sid"); |
|
|
|
if (StringUtils.isNotBlank(dto.getPicUrl())) { |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
String path = dto.getPicUrl().substring(urlPrefix.length()); |
|
|
|
lpkGoods.setPicUrl(path); |
|
|
|
} |
|
|
|
baseMapper.updateById(lpkGoods); |
|
|
|
} else { |
|
|
|
LpkGoods goods=baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("name",dto.getName())); |
|
|
|
if(null!=goods){ |
|
|
|
return rb.setMsg("商品名不能重复"); |
|
|
|
} |
|
|
|
LpkGoods lpkGoods = new LpkGoods(); |
|
|
|
sid = lpkGoods.getSid(); |
|
|
|
BeanUtil.copyProperties(dto, lpkGoods, "id", "sid"); |
|
|
|
lpkGoods.setCreateTime(new DateTime()); |
|
|
|
if (StringUtils.isNotBlank(dto.getPicUrl())) { |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
String path = dto.getPicUrl().substring(urlPrefix.length()); |
|
|
|
lpkGoods.setPicUrl(path); |
|
|
|
} |
|
|
|
baseMapper.insert(lpkGoods); |
|
|
|
dto.setSignSid(UUID.randomUUID().toString()); |
|
|
|
BaseGoodsSpuDto spuDto=new BaseGoodsSpuDto(); |
|
|
|
BaseGoodsSpuDetailDto detailDto=new BaseGoodsSpuDetailDto(); |
|
|
|
detailDto.setGoodsExplain(dto.getAppContent()); |
|
|
|
spuDto.setSid(dto.getSid()); |
|
|
|
spuDto.setBrandSid(dto.getBrandId()); |
|
|
|
spuDto.setBrandName(dto.getBrandName()); |
|
|
|
spuDto.setGoodsName(dto.getName()); |
|
|
|
spuDto.setGoodsTypeName(dto.getCategoryName()); |
|
|
|
spuDto.setGoodsTypeSid(dto.getCategoryId()); |
|
|
|
|
|
|
|
spuDto.setGoodsUnitSid(dto.getSpecificationUnitSid()); |
|
|
|
spuDto.setGoodsUnitName(dto.getSpecificationUnit()); |
|
|
|
spuDto.setGoodsCode(dto.getCode()); |
|
|
|
spuDto.setBarCode(dto.getBarcode()); |
|
|
|
spuDto.setUseOrgSid(dto.getUseOrgSid()); |
|
|
|
spuDto.setCreateOrgSid(dto.getUseOrgSid()); |
|
|
|
spuDto.setCreateBySid(dto.getUserSid()); |
|
|
|
spuDto.setSortNo(dto.getSort()); |
|
|
|
List<BaseGoodsSkuDto> baseGoodsSkus=new ArrayList<>();//商品sku
|
|
|
|
BaseGoodsSkuDto dto1=new BaseGoodsSkuDto(); |
|
|
|
BaseGoodsSkuExtendDto extendDto=new BaseGoodsSkuExtendDto(); |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
if(StringUtils.isNotBlank(dto.getPicUrl())){ |
|
|
|
String path = dto.getPicUrl().substring(urlPrefix.length()); |
|
|
|
extendDto.setPicUrl(path); |
|
|
|
} |
|
|
|
extendDto.setPackUnit(dto.getUnitName()); |
|
|
|
extendDto.setSalesPrice(dto.getPrice()); |
|
|
|
dto1.setSid(dto.getSkuSid()); |
|
|
|
dto1.setTitle(dto.getWeight()); |
|
|
|
dto1.setIndexes(dto.getRemarks()); |
|
|
|
dto1.setRemarks(dto.getContent()); |
|
|
|
dto1.setSignSid(dto.getSignSid()); |
|
|
|
baseGoodsSkus.add(dto1); |
|
|
|
for (BaseGoodsSkuDto goodsSkus : baseGoodsSkus) { |
|
|
|
goodsSkus.setBaseGoodsSkuExtend(extendDto); |
|
|
|
} |
|
|
|
return rb.success().setData(sid); |
|
|
|
spuDto.setBaseGoodsSpuDetail(detailDto); |
|
|
|
spuDto.setBaseGoodsSkus(baseGoodsSkus); |
|
|
|
ResultBean<List<BaseGoodsSku>> listResultBean = baseGoodsSpuFeign.saveOrUpdateByName(spuDto); |
|
|
|
if(!listResultBean.getCode().equals("200")){ |
|
|
|
return listResultBean; |
|
|
|
} |
|
|
|
List<BaseGoodsSku>skus= listResultBean.getData(); |
|
|
|
|
|
|
|
baseMapper.delete(new QueryWrapper<LpkGoods>().eq("spuSid",skus.get(0).getGoodsSpuSid())); |
|
|
|
LpkGoods lpkGoods=new LpkGoods(); |
|
|
|
BeanUtil.copyProperties(dto,lpkGoods); |
|
|
|
lpkGoods.setSid(UUID.randomUUID().toString()); |
|
|
|
lpkGoods.setSpuSid(skus.get(0).getGoodsSpuSid()); |
|
|
|
lpkGoods.setSkuSid(skus.get(0).getSid()); |
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
lpkGoods.setPeriodValidity(sdf.format(new Date())); |
|
|
|
lpkGoods.setSort("1"); |
|
|
|
baseMapper.insert(lpkGoods); |
|
|
|
return rb.success().setMsg("成功"); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<LpkGoodsDetailsVo> goodsInit(String sid) { |
|
|
|
public ResultBean goodsInit(String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
LpkGoodsDetailsVo vo = new LpkGoodsDetailsVo(); |
|
|
|
LpkGoods lpkGoods = fetchBySid(sid); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
if (null != lpkGoods) { |
|
|
|
BeanUtil.copyProperties(lpkGoods, vo); |
|
|
|
if (StringUtils.isNotBlank(lpkGoods.getPicUrl())) { |
|
|
|
vo.setPicUrl(fileUploadComponent.getUrlPrefix() + lpkGoods.getPicUrl()); |
|
|
|
} |
|
|
|
vo.setCreateTime(sdf.format(lpkGoods.getCreateTime())); |
|
|
|
ResultBean<BaseGoodsSkuVo> w=baseGoodsSkuFeign.initialization(sid); |
|
|
|
if(!w.getCode().equals("200")){ |
|
|
|
return w; |
|
|
|
} |
|
|
|
return rb.success().setData(vo); |
|
|
|
ResultBean<BaseGoodsSpuVo> initialization = baseGoodsSpuFeign.initialization(w.getData().getGoodsSpuSid()); |
|
|
|
if(!initialization.getCode().equals("200")){ |
|
|
|
return initialization; |
|
|
|
} |
|
|
|
LpkGoods lpkGoods1 = baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("skuSid", w.getData().getSid())); |
|
|
|
BaseGoodsSpuVo data = initialization.getData(); |
|
|
|
LpkGoodsDetailsVo lpkGoods = new LpkGoodsDetailsVo(); |
|
|
|
lpkGoods.setBarcode(data.getBarCode()); |
|
|
|
lpkGoods.setCreateTime(data.getCreateTime().toString()); |
|
|
|
lpkGoods.setCode(data.getGoodsCode()); |
|
|
|
lpkGoods.setName(data.getGoodsName()); |
|
|
|
lpkGoods.setUnitName(data.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getPackUnit()); |
|
|
|
// lpkGoods.setTypeCode();
|
|
|
|
lpkGoods.setPrice(data.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getSalesPrice()); |
|
|
|
lpkGoods.setAppContent(data.getBaseGoodsSpuDetail().getGoodsExplain()); |
|
|
|
lpkGoods.setSpecificationUnit(data.getGoodsUnitName()); |
|
|
|
lpkGoods.setSpecificationUnitSid(data.getGoodsUnitSid()); |
|
|
|
// lpkGoods.setNumber(d);
|
|
|
|
lpkGoods.setIsAppletGrounding(lpkGoods1.getIsAppletGrounding()); |
|
|
|
lpkGoods.setContent(data.getBaseGoodsSkus().get(0).getRemarks()); |
|
|
|
lpkGoods.setWeight(data.getBaseGoodsSkus().get(0).getTitle()); |
|
|
|
lpkGoods.setUseTo(lpkGoods1.getUseTo()); |
|
|
|
lpkGoods.setBrandId(data.getBrandSid()); |
|
|
|
lpkGoods.setBrandName(data.getBrandName()); |
|
|
|
lpkGoods.setCategoryId(data.getGoodsTypeSid()); |
|
|
|
lpkGoods.setCategoryName(data.getTypeName()); |
|
|
|
lpkGoods.setStepWeight(lpkGoods1.getStepWeight()); |
|
|
|
lpkGoods.setPeriodValidity(DateUtil.parse(lpkGoods1.getPeriodValidity())); |
|
|
|
lpkGoods.setSort(data.getSortNo()); |
|
|
|
lpkGoods.setSpuSid(data.getSid()); |
|
|
|
lpkGoods.setSkuSid(data.getBaseGoodsSkus().get(0).getSid()); |
|
|
|
lpkGoods.setSid(data.getSid()); |
|
|
|
lpkGoods.setRemarks(data.getBaseGoodsSkus().get(0).getIndexes()); |
|
|
|
lpkGoods.setUseOrgSid(data.getUseOrgSid()); |
|
|
|
lpkGoods.setCreateOrgSid(data.getCreateOrgSid()); |
|
|
|
if (StringUtils.isNotBlank(data.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getPicUrl())) { |
|
|
|
lpkGoods.setPicUrl(fileUploadComponent.getUrlPrefix() + data.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getPicUrl()); |
|
|
|
} |
|
|
|
return rb.success().setData(lpkGoods); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<LpkGoodsDetailsVo> goodsDetails(String sid,String customerSid) { |
|
|
@ -178,7 +279,7 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
|
|
|
|
public ResultBean appletGrounding(String sid,String state) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
LpkGoods lpkGoods = fetchBySid(sid); |
|
|
|
LpkGoods lpkGoods=baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("skuSid",sid)); |
|
|
|
if (null != lpkGoods) { |
|
|
|
lpkGoods.setIsAppletGrounding(state); |
|
|
|
baseMapper.updateById(lpkGoods); |
|
|
@ -190,7 +291,8 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
} |
|
|
|
public ResultBean appletUseTo(String sid,String state) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
LpkGoods lpkGoods = fetchBySid(sid); |
|
|
|
// LpkGoods lpkGoods = fetchBySid(sid);
|
|
|
|
LpkGoods lpkGoods=baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("skuSid",sid)); |
|
|
|
if (null != lpkGoods) { |
|
|
|
lpkGoods.setUseTo(state); |
|
|
|
baseMapper.updateById(lpkGoods); |
|
|
@ -304,16 +406,33 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
List<GoodsTypeVo> list=baseMapper.getType(); |
|
|
|
return rb.success().setData(list); |
|
|
|
} |
|
|
|
public ResultBean<List<GoodsTypeVo>> getGoodsTypeAndBrand() { |
|
|
|
public ResultBean<List<GoodsTypeVo>> getGoodsTypeAndBrand(OrgPathQuery query) { |
|
|
|
ResultBean rb=new ResultBean().fail(); |
|
|
|
GoodsTypeVo vo=new GoodsTypeVo(); |
|
|
|
List<GoodsTypeVo> list=baseMapper.getType(); |
|
|
|
ResultBean<List<BaseGoodsTypeVo>> listResultBean = baseGoodsTypeFeign.listAll(query); |
|
|
|
List<GoodsTypeVo> list=new ArrayList<>(); |
|
|
|
for (BaseGoodsTypeVo datum : listResultBean.getData()) { |
|
|
|
GoodsTypeVo vo1=new GoodsTypeVo(); |
|
|
|
vo1.setName(datum.getGoodsTypeName()); |
|
|
|
// vo1.setId();
|
|
|
|
vo1.setSid(datum.getSid()); |
|
|
|
} |
|
|
|
|
|
|
|
GoodsTypeVo vo1=new GoodsTypeVo(); |
|
|
|
vo1.setName("全部分类"); |
|
|
|
vo1.setId("0"); |
|
|
|
vo1.setSid("0"); |
|
|
|
list.add(0,vo1); |
|
|
|
vo.setTypeVos(list); |
|
|
|
List<BrandVo> list1= IPmsBrandService.getList().getData(); |
|
|
|
ResultBean<List<BaseBrandInfoVo>> listResultBean1 = baseBrandInfoFeign.listAll(query); |
|
|
|
List<BrandVo> list1= new ArrayList<>(); |
|
|
|
for (BaseBrandInfoVo datum : listResultBean1.getData()) { |
|
|
|
BrandVo vo2=new BrandVo(); |
|
|
|
vo2.setBrandName(datum.getBrandName()); |
|
|
|
vo2.setSid(datum.getSid()); |
|
|
|
list1.add(vo2); |
|
|
|
} |
|
|
|
|
|
|
|
vo.setBrandVos(list1); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
@ -396,10 +515,51 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
double a =1.88; |
|
|
|
double b =10; |
|
|
|
System.out.println(a*b); |
|
|
|
public static void main(String[] args) throws AWTException, InterruptedException { |
|
|
|
Robot robot = new Robot(); |
|
|
|
// robot.delay(50000);
|
|
|
|
// 76, 198, 244;
|
|
|
|
int rgb = robot.getPixelColor(1629, 336).getBlue(); |
|
|
|
int rgb1 = robot.getPixelColor(1629, 336).getRed(); |
|
|
|
int rgb2= robot.getPixelColor(1629, 336).getGreen(); |
|
|
|
while (1==1){ |
|
|
|
|
|
|
|
if(rgb!=242){ |
|
|
|
if(rgb1!=80){ |
|
|
|
if(rgb2!=201){ |
|
|
|
System.out.println(1111); |
|
|
|
// robot.mouseMove(1522, 562);
|
|
|
|
// robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
|
|
|
// robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
|
|
|
// robot.delay(100);
|
|
|
|
// robot.mouseMove(1674, 750);
|
|
|
|
// robot.delay(100);
|
|
|
|
// robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
|
|
|
// robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
|
|
|
// robot.delay(100);
|
|
|
|
// robot.mouseMove(1664, 400);
|
|
|
|
// robot.delay(2000);
|
|
|
|
// robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
|
|
|
// robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
|
|
|
// robot.delay(100);
|
|
|
|
// robot.mouseMove(1780,750);
|
|
|
|
// robot.delay(2000);
|
|
|
|
// robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
|
|
|
// robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
System.out.println(222); |
|
|
|
Thread.sleep(2000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// System.out.println(rgb);
|
|
|
|
// robot.mousePress();
|
|
|
|
// double a =1.88;
|
|
|
|
// double b =10;
|
|
|
|
// System.out.println(a*b);
|
|
|
|
} |
|
|
|
/** |
|
|
|
* 去除多余.0 |
|
|
|